Re: MS-DOS better than Applescript??
Re: MS-DOS better than Applescript??
- Subject: Re: MS-DOS better than Applescript??
- From: John W Baxter <email@hidden>
- Date: Wed, 4 Sep 2002 15:23:16 -0700
At 6:15 +0100 9/4/2002, John Delacour wrote:
>
At 9:34 pm +0200 3/9/02, Roman Fischer wrote:
>
>I want to do a simple thing: copy a file into the same folder using an other
>
>name. In (good?) old MS-DOS days this was a simple thing:
>
>
>
>Copy c:\abc\def.txt c:\abc\ghi.txt
>
>
>
>Call me stupid but I did not find a solution to do this in Applescript
>
>(MacOS X 10.1.5). After spending a few evenings in searching for a solution
>
>I still did not find one.
>
>
>
>How can I do such a copy in Applescript (or is MS-DOS really better;-) ?
>
>
If you like working in terminals then do
>
>
cp file1 file1.copy
>
>
and if not, then in AppleScript
>
>
do shell script "cp file1 file1.copy"
>
>
I'd say that's rather more economical than DOS.
It's VERY economical if the file1 is an old-fashioned Macintosh file with a
resource fork. file1.copy lacks all that extra disk space usage, saving
space and copying time. But perhaps undesirable.
Also, the above copy has potentially messed up the file's collection of
ownerships and permissions, and its date information. Better would likely
be
do shell script "cp -p file1 file1.copy"
But now, file1.copy already exists. The cp command would like to ask us
about that (and does so on the standard output), so let's give it the
answer ahead of time if we want to replace the old file1.copy
do shell script "cp -fp file1 file1.copy"
If that's what you mean, of course.
--John (the shell is nice, but can be a 10-edged sword)
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
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.