Page 1 of 1
Environment question
Posted: Fri Apr 01, 2016 3:10 pm
by dunbarx
I need to make a standalone for both Windows (ptui) and Mac. I need to write a file to a remote server. The Mac uses forward slashes (/) to delimit levels of the pathName, but Windows uses backSlashes (\).
How does a standalone know which machine it is running on? The "systemVersion" function can be massaged, but I was wondering if there was an explicit function that was designed for the purpose.
Craig Newman
Re: Environment question
Posted: Fri Apr 01, 2016 4:25 pm
by FourthWorld
You would only need platform-specific path delimiters when calling shell or other things that rely on platform-specific systems.
Chapter 11 of the User Guide, "Transferring Information with Files, the Internet and Sockets", includes this note in a callout box on page 323:
Important: Each platform has its own way for programmers to specify file paths. The file path shown above is in the usual style for file paths on Unix systems. For cross-platform compatibility, LiveCode uses this same forward slash / character in its file path regardless of the current platform. This way, you can generally specify file and work with paths in your scripts without having to convert them when you switch platforms.
Will you be using LC Server to receive the file, or something else?
Re: Environment question
Posted: Fri Apr 01, 2016 6:28 pm
by dunbarx
Richard.
Oh, goody.
Thanks so much.
So LC translates as required, in the same way it does so in other instances, like "write to file" for end-of-line characters.
Craig