applicationResourceDirectory or applicationStorageDirectory

Tuesday, November 6th, 2007

This is small AIR tip: use File.applicationStorageDirectory instead of File.applicationResourceDirectory.

I’ve stuck on this error

SecurityError: fileWriteResource
at runtime::SecurityManager$/checkPrivilegeForCaller()
at flash.filesystem::File/moveToAsync()
at copy_fla::MainTimeline/copy_fla::frame1()
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at global/runtime::ADLEntry()

After some googling I’ve found this forum post. That’s quite interesting. This is answer from Kevin Hoyt:
“As part of the additional security features added to AIR Beta 2, applications are no longer permitted to write to the application resource directory. It is recommended that you use applicationStorageDirectory.”

I’m just curious if applicationResourceDirectory is there just for backward compability of there is some other reason like you know, where is you application installed.

AddThis Feed Button

This is some text prior to the author information. You can change this text from the admin section of WP-Gravatar  I'm living in Bratislava, Slovakia. I'm Senior Flex, AIR Developer for my own company Flexets. Read more from this author


tagged under:

ABOUT THIS AUTHOR

I'm living in Bratislava, Slovakia. I'm Senior Flex, AIR Developer for my own company Flexets.

Get a Trackback link

1 Trackbacks/Pingbacks

  1. Pingback: horneygamer com on July 14, 2008

4 Comments


  1. davidderaedt
    Visit Site
    November 6th, 2007

    Hi there ;)

    The thing is that you still can read from this directory. So, one case you could use it for would be to embed content during the AIR application install process, and then copy it to the storage directory.

    More about this here.


  2. DEL
    Visit Site
    March 26th, 2008

    var objFile:File = new File(”file:///” + File.applicationDirectory.resolvePath(strFilePath).nativePath);

    the output would be like this…
    file:///c:\del\userConf.xml

    This will work fine.

    Although this is wrong but what about those who want to edit installed files. Also this will not work if the user is not an administrator.


  3. Tom
    Visit Site
    April 16th, 2008

    HAAA you CANT write on applicationDirectory on Vista! And moreover, application stop and wait wait wait….

    But however you can write on DocumentDirectory, but AIR sould not be cross OS????


  4. Eric
    Visit Site
    October 14th, 2008

    Thanks DEL for the solution. Works great.

Live Preview

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This site is using OpenAvatar based on
Images is enhanced with WordPress Lightbox JS by Zeo
Clicky Web Analytics