webOS Nation Forums >  webOS developer forums >  Official Classic > Classic bug: Filesystem not closed when entering USB drive mode
Classic bug: Filesystem not closed when entering USB drive mode

  Reply
 
LinkBack Thread Tools Display Modes
Old 01/27/2010, 10:18 AM   #1 (permalink)
Member
 
Join Date: Jul 2009
Posts: 44
Likes Received: 0
Thanks: 0
Thanked 6 Times in 6 Posts
Default Classic bug: Filesystem not closed when entering USB drive mode

I am not sure if you will call this a bug or a feature. And you may not be able to do anything about it. But I hope so.

If a create a file on the virtual card using VFS calls, even if I close the file and even if I exit my app back to the Classic app launcher, the file shows up as zero bytes in USB drive mode unless I first exit Classic.

That is, try these steps:

1) Create a file using VFS (ie on the "Virtual Card")
2) Close the file
3) Optionally exit the palm application which created the file
4) Attach the USB cable and select USB Drive mode
5) Open the ClassicApps folder and look for the file created

It will be there, but with a file size of zero bytes.

If have found two work-arounds:

1) Exit Classic prior to attaching USB cable, or
2) Remove USB, attach a second time, and enter USB drive mode again

It seems like removing the USB cable gives Classic time to shut down and exit, so the second time you enter drive mode the file has the correct size.

I don't know if this is a case of webOS pre-empting Classic and not giving it a chance to close its calls to the filesystem, or if there is any notification you can get prior to USB drive mode starting.

If there is no notification, is is possible for Classic to somehow flush its file buffers or whatever after a VFS file has been closed?

Some of my apps use the memory card (or Virtual card in the case of Classic) to exchange data with a desktop app. And the files are showing up as zero bytes unless Classic is exited or USB drive mode entered twice.
PreOwned is offline   Reply With Quote
Old 01/28/2010, 09:30 AM   #2 (permalink)
webOS Developer
 
Classic by MotionApps's Avatar
 
Join Date: Jul 2009
Posts: 350
Likes Received: 0
Thanks: 162
Thanked 70 Times in 43 Posts
Default

Well, this is neither a bug nor a feature, at least as far as Classic is concerned.

This is the way USB Drive mode works, Classic cannot alter it. It seems as if USB Drive mode needs some time to "get together", and your workaround to exit and then go back "helps it".
__________________
Follow us on Twitter

Hang out with us on Facebook

Stay Tuned with news and updates on our blog
Classic by MotionApps is offline   Reply With Quote
Old 01/28/2010, 10:27 AM   #3 (permalink)
Member
 
Join Date: Jul 2009
Posts: 44
Likes Received: 0
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
Originally Posted by Classic by MotionApps View Post
This is the way USB Drive mode works, Classic cannot alter it. It seems as if USB Drive mode needs some time to "get together", and your workaround to exit and then go back "helps it".
That's a bummer.

Experimenting more, it seems it is not necessary to completely leave Classic. If I create a file via VFS calls then switch tasks to Internalz, the filesizes are already updated. So it appears webOS flushes out the contents prior to switching foreground tasks, but not before going into USB drive mode.

But it isn't like I can easily train users to do that either. So I guess I just need to update my desktop apps to look for zero byte files under ClassicApps, then issue a message asking them to remove the cable and go back into USB drive mode again.
PreOwned is offline   Reply With Quote
Old 01/29/2010, 07:03 AM   #4 (permalink)
webOS Developer
 
Classic by MotionApps's Avatar
 
Join Date: Jul 2009
Posts: 350
Likes Received: 0
Thanks: 162
Thanked 70 Times in 43 Posts
Default

A bummer it is – but you’ve ended up on our Facebook and Twitter with your tips and tricks. Thanks!
__________________
Follow us on Twitter

Hang out with us on Facebook

Stay Tuned with news and updates on our blog
Classic by MotionApps is offline   Reply With Quote
Old 01/29/2010, 08:36 AM   #5 (permalink)
Member
 
Join Date: Jul 2009
Posts: 44
Likes Received: 0
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
Originally Posted by Classic by MotionApps View Post
A bummer it is – but you’ve ended up on our Facebook and Twitter with your tips and tricks. Thanks!
In the meantime, in my palm os apps, when I detect I am running under webOS and people request an export of data out to the "card", I now changed my completion dialog to instruct them to "Fully exit Classic before attaching USB cable". Hopefully that will train them.

I also plan to change my desktop apps, which now look for the ClassicApps folder off the root of a removable drive, to check if any file size is zero bytes. If it it and \ClassicApps exists, I will do a dialog asking them to remove and re-insert the USB cable.

Not as good as having the file system updated the first time, but at least should avoid support requests.

Maybe.
PreOwned is offline   Reply With Quote
Thanked By: Classic by MotionApps
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0