Re: Very slow copying of files to a server using Finder in 10.6
Re: Very slow copying of files to a server using Finder in 10.6
- Subject: Re: Very slow copying of files to a server using Finder in 10.6
- From: Luther Fuller <email@hidden>
- Date: Fri, 04 Feb 2011 13:37:51 -0600
On Feb 4, 2011, at 12:49 PM, Stefan Economou wrote: In Snow Leopard, an Applescript controlling Finder experiences the spinning beachball for several minutes when copying files to a mounted server, although the file transfer is successful eventually. This has always worked fine in Leopard and previous OS (since 2002), file transfers take a second or two.
To solve this, I used a UNIX "do shell script" cp command outside the Finder tell block (instead of "duplicate file" within the Finder tell block); the file transfers are fast and easy again. The server is an old XServe on our local network.
Yes, I had the same problem some time ago (damned beachball). I solved it with this handler ...
on copyFile(fileAlias, targetAlias, newFileName) -- fileAlias is an alias to the source file, targetAlias is an alias to the destination folder and newFileName is a string set sourcePath to (quoted form of POSIX path of fileAlias) set targetPath to (quoted form of (POSIX path of ((targetAlias as text) & newFileName))) try do shell script "cp -np " & sourcePath & space & targetPath return ((targetAlias as text) & newFileName) as alias end try return {} end copyFile --------------------------------------------------------------------
There is one problem: file comments are not preserved. You have to get the comment of the original file, then set the comment of the new file. I think other file properties are preserved, but I'm not absolutely sure because it's been some time since I wrote this handler.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden