Re: Problems with files on OS X
Re: Problems with files on OS X
- Subject: Re: Problems with files on OS X
- From: garbanzito <email@hidden>
- Date: Fri, 22 Mar 2002 09:31:33 -0700
at 2002 03 22, 09:43 +0100, they whom i call Xavier Ambrosioni wrote:
2/ When i use the command:
'write my_text1 & return & my_text2 to my_file starting at eof'
there is only one line in my_file. If I open the file with vi on Terminal, I
can see the character "^M" in place of the return (or \n) character.
don't know about the write permission issue, but this one
has a good explanation ...
from the "Mac" perspective, there _are_ two lines in your
file because ^M (the carriage return character, ASCII 13) is
marks end-of-line for Mac files. AppleScript works from this
perspective. but from the BSD perspective line-feed (^J or
ASCII 10) is end-of-line and there appears to be only one
line.
some apps like TextEdit, handle this transparently, but for
unix command-line use, you might want to write your code to
use ASCII 10, or you could use "tr" on the command line to
fix files after the fact.
--
steve harley email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.