Answer file under OSX and cross platform file names
paul at researchware.com
Sat May 27 18:32:47 EDT 2017
OSX allows the slash character in file and folder names.
LiveCode uses the slash as the delimiter between path items in file paths.
So when you execute:
answer file "Pick an OSX file with a slash in the name"
Livecode substitutes a colon for the slash in the name. Colon is an
illegal character for file names under OSX. Likewise if you have code
that tests for a file (or any file operation) that contains a colon,
LiveCode replaces it with a slash for the operation. i.e.
put (there is a file "my:file.txt") -- produces true of there is an OSX
file "my/file.txt" in the default folder
This is all great for handling files on OSX, but if your application
saves file names and is used cross-platform (i.e. say under Windows as
well as OSX), then the colon is a problem because colons are not allowed
in Windows file names. This is also a slight cosmetic issue under OSX
since if you display the file name the user responded with, it does not
match the name the user selected as the slash has been replaced by a colon.
Now both issue - cross platform file name use and the cosmetic issue of
displaying the file on OSX - are easily resolved in code.
My issue is that no where in the Dictionary (that I can find) does it
note that slashes in OSX names are replaced with colon in LiveCode. This
documentation omission has consumed a lot of time on my part discovering
this little annoyance.
So, for documentation errors or enhancements, do I file a quality center
report? The only options in the popup are bug or enhancement. Should
there be a 3rd option for Documentation so such documentation issues can
easily be searched and segregated?
More information about the Use-livecode