Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon
Accepted Solution

File.moveTo corrupt?

Has anyone seen the File moveTo function corrupt the file being moved.  I spent a week trying to figure out why a file I moved out from app-storage to documents could not be opened. I changed it to copyTo(...), and the file was fine (I delete the file after the copy).  The same function on Windows and Android works fine.  Feature of the OS?  Not the end of the world since I found a work around, but if others have seen this, then I will report it as a bug.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: File.moveTo corrupt?

John, if you're moving things between sandbox and shared, I think I've already reported that as https://www.blackberry.com/jira/browse/TABLET-373

 

Discussion was in http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Bad-groupid-and-userid-on-files-c... from November.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: File.moveTo corrupt?

Workarounds that can work depending on your situation include initially creating the file in shared, then moving it to sandbox for changes, then back out. Also what I did, just create a temporary file (prefixed with "." though of course not everything respects the convention that this means "hidden"), and then rename it after I'm doing creating it (which can take some minutes for Battery Guru export files).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: File.moveTo corrupt?

That must be it. Sending files directly to the shared/documents area is fine. But if I first send it to the app-storage and then move it to the shared area, nothing can read it. However, if I copy the file from app-storage, it works fine. This one really took some playing around to figure out what was wrong. Receiving the file from the remote location had the same size and hash, but nothing could read it. Thanks...