Is there a good way to lock a file?
So basically as long the app is running and you try to remove that file, you get a warning it is still open for reading/writing
This doesn’t work:
Dim sourceFile As Folderitem
Dim t As TextInputStream
sourceFile = SpecialFolder.Preferences.child("lockfile.txt")
t=TextInputStream.Open(sourceFile)
I do not close the Textinputstream with t.close to make sure it stays open.
But still you can delete the file without OSX complaining it is busy.
Any way to make OSX complaining the file is still being read/written to?