Hey Stack Overflow community,
Another Adobe AIR question for you: 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).
Thanks, Mauricio
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);