applicationResourceDirectory or applicationStorageDirectory

Utorok, 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.


tagged under:

ABOUT THIS AUTHOR

1 Trackbacks/Pingbacks

  1. Spätné upozorenie: horneygamer com on Júl 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
    Marec 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
    Apríl 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
    Október 14th, 2008

    Thanks DEL for the solution. Works great.

Sorry, comments for this entry are closed at this time.

Images is enhanced with WordPress Lightbox JS by Zeo