views:

189

answers:

1

I am testing some stuff out with writing to the filesystem on the Blackberry using the javax.microedition.io.file package. I am able to open a file ("file:///store/home/user/documents/mytxtfile.txt") and write to it (by that I mean that no exception is thrown, whether or not the file is created and written, I can't tell).

I am running in a simulator and I was wondering where the simulator would write such files? Looking in the simulator directory there has been no changes to any of the files, so none of the .dmp files have changed since this file was written. Does anyone know where this file would be written, just so that I can confirm that it was actually written?

+2  A: 

By default the BlackBerry filesystem is represented as a single file on the host system. You'll see this file in your simulator directory, something like 8900-fs.dmp (for the 8900 simulator, for example) or 8900-sdcard.dmp (for the filesystem on the virtual SD card for the same device).

Unfortunately you can't browse files stored to the simulator's device filesystem, but you can configure the simulator to use an actual directory for its SDCard. This is in the Memory tab of the simulator dialog (under Debug Configurations -> Simulator if you're using the Eclipse JDE Plug-in). You can write to the SDCard using the file:///sdcard prefix

Another option is that there is a file browser built in to the BlackBerry - it's (unintuitively) under the 'Media' icon. Click the Media icon, then open the menu and there's an Explore menu item. You'll be able to browse the simulator's filesystem and see if your file is there.

Anthony Rizk
Thanks, I found the file in the Media section, so it was written. Any idea why none of the .dmp files in the Simulator directory changed? I'm basing that on the fact that the size of the file and the last modified date as shown in Windows explorer have not changed.
DaveJohnston
It's ok, I found out what is going on. The build scripts that we are using set another directory to be used to store these files. So I found the .dmp file that is being updated.
DaveJohnston