Can we write files to the file system and leave them as read-only in Adobe AIR?
In the future, we would overwrite these files (or delete them and write a new one).
Update:
I tried the following approach, but I was still able to open the file, edit, and save to the file system after the process executed.
var testFile:File = File.desktopDirectory;
var testFileStream:FileStream = new FileStream();
testFile = testFile.resolvePath("testreadonly.txt");
testFileStream.open(testFile, FileMode.WRITE);
testFileStream.writeUTF("test read only string");
testFileStream.close();
var readFileStream:FileStream = new FileStream();
readFileStream.open(testFile, FileMode.READ);
var test:String = readFileStream.readUTF()
Alert.show("DONE, READ" + test);
You do not have API in Adobe AIR in order to modify file attributes (like read only, hidden etc). The mode property specifies how do you want to open the file in your session, it does not set any read only flag.