Skip to main content
October 15, 2012
Question

Add Method to flash.filesystem.File

  • October 15, 2012
  • 4 replies
  • 630 views

I think it would be a great idea to add a new method to resolve a storage directory for public application data.

Sometimes you need to save a config file, database file, or any other kind of file in a location specific to your app but not specific to a single user on a machine.

Somthing like:

var _file:File = File.applicationPublicDirectory.resolvePath('myfile.txt');

Would reference

[Windows 7]        C:\programdata\MyApp\myfile.txt

[Mac OSx]            \Library\Application Support\MyApp\myfile.txt

[Windows XP]     C:\Documents and Settings\All Users\Application Data\MyApp\myfile.txt

I have made a rough fix for my orginal problem here: http://forums.adobe.com/message/4767669

but I think this is something that should be provided by sdk

This topic has been closed for replies.

4 replies

chris.campbell
Legend
October 16, 2012

Thanks for the suggestion.  I agree, this could be handy.  Are there permission issues that might be encountered on Windows Vista and 7?  Something to consider I guess. 

Could you please open a new report on this over at bugbase.adobe.com?  Please post back with the URL so that others interested can add their comments and votes.

October 16, 2012
October 16, 2012

I was able to write in all those locations from Air by opening them with hard coded directories

var file:File = new File('C:\\programdata\\MyApp\\myfile');

var file:File = new File( 'C:\\Documents and Settings\\All Users\\Application Data\\MyApp\\myfile.txt');

var file:File = new File('\\library\\Application Support\\MyApp\\myfile.txt');

So far no issues with permissions.

I tested Windows 7 x64, Mac OSX, & Windows XP x32