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

Re: [MacPerl] Copying Files



On Tue, May 19, 1998 at 09:07:19PM -0400, Kevin Lindsey wrote:
} I think that I've been staring at the screen for too long!
} 
} How does one copy a file from one volume to another.  I've tried FSpCatMove,
} but I get an error about a bad volume.  I guess this is used only for moving
} files on the same volume.
} 
} I found FSpFileCopy, but I'm not sure how to make the FSSpecs that are needed.
} Specifically, I'm not sure how to get the directory and volume id's.  It
} would be nice not to resort to cat'ing the data and resource forks.  Also, if
} possible, I would like to avoid using Apple Events for this one.
} 
} I'm sure I'm missing the obvious here.

use File::Copy;

copy($file1,$file2);

I can't tell for sure just by looking, and I'm not running MacOS at
the moment, but I think this will do cross volume copies.  It also deals
with the resource fork of the file properly.


} 
} TIA,
} Kevin
} 

---
Paul Schinder
schinder@pobox.com

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