Hi all..
been trawling the forum for hours, (and I mean HOURS),.. and messing about with code.
I have a simple program that writes to a USB stick(Once a second) using MSCFileSystem, and it works.
I can pull the USB stick and the program doesn't stop working.
When you try to open the file, it returns a NULL filehandle, and you just trap that and it's fine.
Where I am flummoxed is that I HAVE to have a USB stick on the USB socket on startup, otherwise the program hangs at whatever test I try to do to see if there is a stick there.
opendir
fopen for read
fopen for write
fopen for append
disk_status
disk_initialise
They *all* hang if there is no stick in the socket.
However,.. if there is a stick in the socket on startup, I can merrily pull it after a few secs, and the program is fine.
I just can't find a way to test *something* is NULL if the stick isn't there.
There's a note on MSCFileSystem saying insertion/removal not implemented and you have to have a stick in on startup, but I thought there'd be *some* way of looking, but it hangs.
if anyone has any ideas.. I'd be most grateful.
cheers
Dave
Hi all..
been trawling the forum for hours, (and I mean HOURS),.. and messing about with code.
I have a simple program that writes to a USB stick(Once a second) using MSCFileSystem, and it works.
I can pull the USB stick and the program doesn't stop working. When you try to open the file, it returns a NULL filehandle, and you just trap that and it's fine.
Where I am flummoxed is that I HAVE to have a USB stick on the USB socket on startup, otherwise the program hangs at whatever test I try to do to see if there is a stick there.
opendir fopen for read fopen for write fopen for append disk_status disk_initialise
They *all* hang if there is no stick in the socket.
However,.. if there is a stick in the socket on startup, I can merrily pull it after a few secs, and the program is fine.
I just can't find a way to test *something* is NULL if the stick isn't there.
There's a note on MSCFileSystem saying insertion/removal not implemented and you have to have a stick in on startup, but I thought there'd be *some* way of looking, but it hangs.
if anyone has any ideas.. I'd be most grateful.
cheers
Dave