#115182 - SukkoPera - Sat Jan 13, 2007 3:58 pm
I'm trying to make libfat and my libblockdev live together in the same application. Although I can't fully understand the whole device managemente in newlib.
This is how _I THINK_ it works:
- I register both both libfat and libblockdev using AddDevice(). I guess I should check its return value, so I assumed that anything >= 0 is OK, while < 0 means an error. This way it seems that both libraries get registered correctly.
- I don't set either one as the "default device". I don't know exactly what a "default device" is. I guess it's the one used when dealing with paths that don't start either with "fat:" or "raw:" (which are the names declared in the first element of devoptab_t of the two libraries). Therefore I guess I have to use explicit pathnames when opening a file.
- Problem is that all file operations are always performed with the library I register last, independently of the path name. Also, FindDevice() returns -1 for the previously registered library.
Is this normal (maybe I cannot register more than one device at the same time, but then why the need of a name and of a default device?) or am I wrong somewhere?
_________________
Nintendo DS Lite (White) + Supercard Lite + R4 + Sandisk 1 GB MicroSD
Sony PSP + Firmware 3.03 OE-A2
This is how _I THINK_ it works:
- I register both both libfat and libblockdev using AddDevice(). I guess I should check its return value, so I assumed that anything >= 0 is OK, while < 0 means an error. This way it seems that both libraries get registered correctly.
- I don't set either one as the "default device". I don't know exactly what a "default device" is. I guess it's the one used when dealing with paths that don't start either with "fat:" or "raw:" (which are the names declared in the first element of devoptab_t of the two libraries). Therefore I guess I have to use explicit pathnames when opening a file.
- Problem is that all file operations are always performed with the library I register last, independently of the path name. Also, FindDevice() returns -1 for the previously registered library.
Is this normal (maybe I cannot register more than one device at the same time, but then why the need of a name and of a default device?) or am I wrong somewhere?
_________________
Nintendo DS Lite (White) + Supercard Lite + R4 + Sandisk 1 GB MicroSD
Sony PSP + Firmware 3.03 OE-A2