"$Bill Luebkert" <[EMAIL PROTECTED]> writes:

> Carl Jolley wrote:
> > 
> > On Sun, 30 Apr 2000, Steven Willard wrote:
> > 
> > > I am running windows 2000 professional with perl AS 506.  I installed
> > > Fileop, Lazy, Win32-api and Win32-abspath from Jenda's site.  I created the
> > > following
> > >
> > > use Win32::FileOp;
> > >
> > > Copy ('e:\oldfile\test.txt' => 'e:\newfile\\');
> > >
> > > All paths exist and yet nothing happens when I run it inside CodeMagic.
> > > When I run it from the dos prompt, I get perl application errors.
> > >
> > > Can anyone provide some insight.  I need to be able to copy files.
> > >
> > 
> > Since you are escaping the last backslash why not the others?
> 
> My first thought also, but what are the only two chars you escape inside 's?
> Answer:  \ and '   So the last \ was to make sure the ' wasn't escaped by 
> mistake.  :)  Personally I would use /s instead.

And personally, I would

    use File::Copy;   # portable!

    copy('e:/oldfile/test.txt', 'e:/newfile');  # forward slashes

(Unless Win32::FileOp is being used for other reasons.)

And also use forward slashes as $Bill suggests.

And a portable method for determining an absolute path is:

    use Cwd 'abs_path';

    print abs_path('a/partial/path');

--David


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to