LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
on mouseUp
answer file "Open"
if it = empty then exit mouseUp
put url("file:" & it) into tText
put mactoIso(numtochar(142)) into tSearchFrench
put mactoIso(numtochar(138)) into tSearchGerman
if matchText(tText,tSearchFrench) or matchText(tText,tSearchGerman) then
put "Iso" into tSource
else
put "Mac" into tSource
end if
answer "This file was created on" && tSource
end mouseUp
jacque wrote:
Yes.
But oops, I got it backwards. Windows line endings are CRLF.
Not always.
I'm using Notepad++ as a text editor on Windows and have it setup to save line endings as LF.
This is fairly common if anyone is using a programmers editor.
Wondered about that. I wasn't sure how predictable the line endings would be. On my Mac I have BBEdit set to use Linux line endings, so I don't follow the norm either. So probably a shell command is a better deal if there is one available on each platform.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
function getFileCreatePlatform pFile
put url ("binfile:" & pFile) into x
put "n/a" into LsepLine
put 0 into LBOMlength
if offset(numToChar(13)&numToChar(10),x) > 0 then
put "win" into LsepLine
else if offset(numToChar(10),x) > 0 then
put "unix" into LsepLine
else if offset(numToChar(13),x) > 0 then
put "mac" into LsepLine
end if
return LsepLine
end getFileCreatePlatform