I've searched and am unable to find any way to determine flash0 free space.
The Memory Stick Devctl command obviously won't because the command is different.
SilverSpring wrote:Just like the MS drivers, both the lflash block driver and lfat filesystem driver provide devctl commands to determine free space, in terms of both free sector space of the flash partitions (via the lflash IO driver) as well as free cluster space of the FAT filesystem (via the lfat IO driver).
I have worked in a flashfat emulator (the timemachine) and I don't remember to have seen any command to calculate free space.
I would learn a bit about fat filesystem, and calculate the free space myself reading the raw lflash0:0,0 device, basically free_clusters * sizeof(cluster) :)
moonlight wrote:I have worked in a flashfat emulator (the timemachine) and I don't remember to have seen any command to calculate free space.
I would learn a bit about fat filesystem, and calculate the free space myself reading the raw lflash0:0,0 device, basically free_clusters * sizeof(cluster) :)
EDIT:
So how do I read from the device? I can do the file system work with some googling. I don't know how to use the functions to read the device.
I'm reading about the filesystem right now.
But what about the devctl commands that SilverSpring mentioned. If it can directly get the number of free sectors in a partition it will save a lot of work.
Sorry I didn't get it to work since I do not know exactly the params it returns. It's not free clusters directly but several values from which to calculate from.
Also I was mistaken, only the devctl from the filesystem driver exists not from the logical block driver.
SilverSpring wrote:Also I was mistaken, only the devctl from the filesystem driver exists not from the logical block driver.
It doesn't matter, because calculating free space from the sectors is more trouble than its worth and will probably be erroneous. Only cluster space is practical.
Calculating clusters from the FAT appears to be a trivial task anyway.