|
A function that can be used in Scripting.
tryToAppendFile
(filePath$
)
The file is opened for appending, then closed (if the file already existed, it is not changed).
Upon success (i.e. the file already existed and can be appended to, or the file didn’t exist yet but was successfully created), this function returns 1 (true). Otherwise, the function returns 0 (false); this can happen if the folder in the path does not exist, or if the file is (or would be) on a read-only device.
For instance, if my TIMIT database is in a read-only disk image called TIMIT.dmg
, and I mounted that disk image on my Mac (by double-clicking TIMIT.dmg
), then trying
tryToAppendFile ("/Volumes/TIMIT/readme.doc")
would return 0.
For a non-destructive version of this function, see tryToWriteFile
.
© Paul Boersma 2023