Environment question

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Environment question

Post by dunbarx » Fri Apr 01, 2016 3:10 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Environment question

Post by FourthWorld » Fri Apr 01, 2016 4:25 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Environment question

Post by dunbarx » Fri Apr 01, 2016 6:28 pm

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

Post Reply