Blackberry Simulator FileSystem: where is it?
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?
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.
精彩评论