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
Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

deleteDirectory bug

File.deleteDirectory(true) and File.deleteDirectoryAsync(true) fail when deleting a directory on the SD card that contains files or subdirectories. The "true" parameter indicates that the delete operation should be recursive and delete any files or subdirectories.

 

deleteDirectory throws a "Error #3001: File or directory access denied." exception.
deleteDirectoryAsync fires an IOErrorEvent.

 

Works OK on the internal device memory, or when the directory is empty.

 

OS version: 10.0.10.648 
AIR SDK version: 3.1.1 
AIR runtime version: 3.1.0.108

 

JIRA entry: https://www.blackberry.com/jira/browse/BBTEN-1032

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: deleteDirectory bug

Can you manually delete a directory on the SDCard? sounds like you dont have permission to delete on that partition.

Probably good to listen to the IOErrorEvent so you can at least properly inform the user.
Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: deleteDirectory bug

Yes, if you first delete files and subdirectories recursively. It's not a permissions thing.

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: deleteDirectory bug

Recursively programmatically or manually?
Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: deleteDirectory bug

Either

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: deleteDirectory bug

In doing a Google search, it sounds like this is a feature to SD cards because it has the ability to recover files, so there might be links to files to help with this. Have you inspected the files to see if they are links in any way. From other forums, it appears the recursive way is the best way for SD Cards.

Also, is the lock tab off on the SDCard you have?
Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: deleteDirectory bug

John,

 

It's just a bug. I've worked around it. You can stop troubleshooting now ;-)

 

MicroSD has no lock tab. And if it did, it would prevent creating the directory in the first place.

 

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Highlighted
Retired
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: deleteDirectory bug

I've escalated this issue to the AIR SDK team.

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: deleteDirectory bug

Dustin, this may be related:

https://twitter.com/brainsforrent/status/291191279541428226

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands