Peter Reid wrote/ schreef:
> I'm using the following script to copy a file from one folder to
> another where it may or may not already exist (Mac MC 2.3.2,
> buildnumber 6):
>
> put URL ("binfile:" & origFilePath) into URL ("binfile:" & newFilePath)
>
> The problem was the origFilePath which was of the form "/Mac
> HD/sourcefile1.txt", i.e. I'd forgotten to insert a "/" between the
> path and the file name.
>
> What's interesting is that I got no error messages and it appeared to
> work, but produced empty destination copies. Once I'd spotted the
> error and corrected the source file path, it worked fine!
Well, interesting, yes, but weird, no, because you could use
URL "binfile:/Mac HD/sourcefile1.txt"
Also to store data in, so why couldn't you then use it as a source? This
means that you'll have to check for the existence of the file.
function fileExists tPath
set itemDel to "/"
put the directory into tSaveDirectory
set the directory to item 1 to -2 of tPath
set wholeMatches to true
return lineOffset(item -1 of tPath,the files,1) is not "0"
-- skip the first line because that's always ".."
end fileExists
Not tested, just from the top of my head.
> Cheers
>
> Peter
Regards,
Sjoerd
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.