Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Difference Of Location Storage File in air

I want to ask the difference between air.File.documentsDirectory.resolvePath, File.userDirectory.resolvePath, air.File.applicationDirectory.resolvePath..

Can anybody explain when does the file will be store.....

especially in windows

like image 991
Frans Simanjuntak Avatar asked Nov 09 '10 03:11

Frans Simanjuntak


3 Answers

AIR's applicationStorageDirectory will automatically target these locations depending on which OS the application is running:

  • Windows 7 / Vista: c:\users\USERNAME\appdata\roaming\APPLICATIONNAME

  • Windows XP: c:\Documents and Settings\USERNAME\Application Data\APPLICATIONNAME

  • Mac OS X: /Users/USERNAME/Library/Preferences/APPLICATIONNAME

  • Linux (Ubuntu): /Users/USERNAME/.appdata/

along with desktopDirectory, documentsDirectory, applicationDirectory (read-only), which, too, have their own specific locations, these are built-in conveniences that allow AIR developers to produce cross-platform applications without having to know about (or specifically code for) the file system of a target OS.

like image 197
Chunky Chunk Avatar answered Oct 16 '22 04:10

Chunky Chunk


This info applies to AIR 1.0 and later (ActionScript 3.0)

  • File.applicationStorageDirectory: a storage directory unique to each installed AIR application. This directory is an appropriate place to store dynamic application assets and user preferences. Consider storing large amounts of data elsewhere. On Android and iOS, the application storage directory is removed when the application is uninstalled or the user chooses to clear application data, but this is not the case on other platforms.

  • File.applicationDirectory: the directory where the application is installed (along with any installed assets). On some operating systems, the application is stored in a single package file rather than a physical directory. In this case, the contents may not be accessible using the native path. The application directory is read-only.

  • File.desktopDirectory: the user’s desktop directory. If a platform does not define a desktop directory, another location on the file system is used.

  • File.documentsDirectory: the user’s documents directory. If a platform does not define a documents directory, another location on the file system is used.

  • File.userDirectory: the user directory. If a platform does not define a user directory, another location on the file system is used.

If you specify a publisher ID in the AIR application descriptor, then the publisher ID is appended to the applicationID.

Android

  • File.applicationDirectory (read-only)

    /data/data/

  • File.applicationStorageDirectory

    /data/data/<applicationID>/<filename>/Local Store

  • File.cacheDirectory

    /data/data/<applicationID>/cache

  • File.desktopDirectory

    /mnt/sdcard

  • File.documentsDirectory

    /mnt/sdcard

  • temporary - from File.createTempDirectory() and File.createTempFile()

    /data/data/<applicationID>/cache/FlashTmp.<randomString>

  • File.userDirectory

    /mnt/sdcard

iOS

  • File.applicationDirectory (read-only)

    /var/mobile/Applications/<uid>/<filename>.app

  • File.applicationStorageDirectory

    /var/mobile/Applications/<uid>/Library/Application Support/<applicationID>/Local Store

  • File.cacheDirectory

    /var/mobile/Applications/<uid>/Library/Caches

  • File.desktopDirectory - not accessible

  • File.documentsDirectory

    /var/mobile/Applications/<uid>/Documents

  • temporary - from createTempDirectory() and createTempFile()

    /private/var/mobile/Applications/<uid>/tmp/FlashTmp<randomString>

  • File.userDirectory - not accessible

Linux

  • File.applicationDirectory (read-only)

    /opt/<filename>/share

  • File.applicationStorageDirectory

    /home/<userName>/.appdata/<applicationID>/Local Store

  • File.desktopDirectory

    /home/<userName>/Desktop

  • File.documentsDirectory

    /home/<userName>/Documents

  • temporary - from createTempDirectory() and createTempFile()

    /tmp/FlashTmp.<randomString>

  • File.userDirectory

    /home/<userName>

Mac

  • File.applicationDirectory (read-only)

    /Applications/<filename>.app/Contents/Resources

  • File.applicationStorageDirectory (AIR 3.2 and earlier)

    /Users/<userName>/Library/Preferences/<applicationID>/Local Store

  • File.applicationStorageDirectory (AIR 3.3 and later)

    /Users/<userName>/Library/Application Support/<applicationID>/Local Store

  • File.applicationStorageDirectory (AIR 3.3 and later) sandboxed

    /Users/<userName>/Library/Containers/<bundleID>/Data/Library/Application Support/<applicationID>/Local Store

  • File.cacheDirectory

    /Users/<userName>/Library/Caches

  • File.desktopDirectory

    /Users/<userName>/Desktop

  • File.documentsDirectory

    /Users/<userName>/Documents

  • temporary - from createTempDirectory() and createTempFile()

    /private/var/folders/<userName?>/<randomString>/TemporaryItems/FlashTmp

  • File.userDirectory

    /Users/<userName>

Windows

  • File.applicationDirectory (read-only)

    C:\Program Files\<filename>

  • File.applicationStorageDirectory

    C:\Documents and settings\<userName>\ApplicationData\<applicationID>\Local Store

  • File.cacheDirectory

    C:\Documents and settings\<userName>\Local Settings\Temp

  • File.desktopDirectory

    C:\Documents and settings\<userName>\Desktop

  • File.documentsDirectory

    C:\Documents and Settings\<userName>\My Documents

  • temporary - from createTempDirectory() and createTempFile()

    C:\Documents and Settings\<userName>\Local Settings\Temp\<randomString>.tmp

  • File.userDirectory

    C:\Documents and Settings\<userName>

Source

like image 31
Mike Partridge Avatar answered Oct 16 '22 04:10

Mike Partridge


Copying from Victor's comment: In later versions of OS X, applicationStorageDirectory will be in /Users/USERNAME/Library/Application Support/APPLICATIONNAME

This is the correct location in MAC OS in 2016

like image 1
Zachos Stefanakis Avatar answered Oct 16 '22 06:10

Zachos Stefanakis