[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Please help with use of Mac::MoreFiles::FSpFileCopy ... THANKS



Alan,
        Thanks for the help.

 foreach $mapfile (split(/=/,$types_of_file_list{"m.gif"})) {
   #FSpFileCopy SRCSPEC, DSTSPEC, COPYNAME, PREFLIGHT
   $SRCSPEC = $allfiles{$mapfile};
   $DSTSPEC ="MacOS:all-maps:";
   $COPYNAME="$mapfile";
   Mac::MoreFiles::FSpFileCopy($SRCSPEC, $DSTSPEC,$COPYNAME,"");
   }

The trick, as pointed out by your self and shuck, is that DSTSPEC
is the name of the destination folder. Rather than the fullname
of the new file I wanted created. That and COPYNAME is a required
parameter.

Not the most intuitive interface!

>>        Could anybody show me an example of FSpFileCopy in use.
>>        I want to copy a couple of hundred files sprinkled across
>>        a CDrom into one folder on my HD!
>>
>>        What is this preflight stuff!
>>
>>foreach $mapfile (split(/=/,$types_of_file_list{"m.gif"})) {
>>   #FSpFileCopy SRCSPEC, DSTSPEC, COPYNAME, PREFLIGHT
>>   $SRCSPEC=$allfiles{$mapfile};
>>   $DSTSPEC="MacOS:all-maps:$mapfile";
>>   Mac::MoreFiles::FSpFileCopy($SRCSPEC, $DSTSPEC,0,"");
>>   }
>
>Firstly, the script _must_ start:
>
>        use Mac::MoreFiles;
>
>on its own and _then_ simply:
>
>        FSpFileCopy ( "full path to the file to be copied",
>                      "full path to destination volume or folder",
>                      "name - either the old one or a new one",
>                      1 );
>
>You do not have to change the name of the file, but you can do if you want.
>
>If the destination is a volume the string must end with a colon, but if the
>destination is a directory no terminating colon is necessary.
>
>The path strings obviously have to be in quotes - single will do unless
>there is something in the string to interpolate of course. You can use an
>(unquoted) variable (like $allfiles{$mapfile} for instance) provided it
>evaluates to a full path name.
>
>What the prefilght stuff is, heaven knows. I've seen Matthias use a 1 and
>that generally seems to work. One would need to delve into "Inside
>Macintosh", which I confess not to have done...
>
>Hope this helps, but do come back if you have any problems getting it to work.
>
>Alan


======================================================================
Fergus McMenemie               Email:fergus@twig.demon.co.uk.
Technical Basis                Phone:0421 376 021

Unix/Mac/Intranets             Analyst Programmer
======================================================================



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch