Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: File name is long to copy

by marto (Cardinal)
on Apr 26, 2020 at 13:31 UTC ( [id://11116079]=note: print w/replies, xml ) Need Help??


in reply to Re^2: File name is long to copy
in thread File name is long to copy

Which version of Windows? It doesn't look like you tried what I suggested, note the $!

copy( $source, $target ) or die "couldn't copy file $!"; #---------------------------------------------------^

Replies are listed 'Best First'.
Re^4: File name is long to copy
by harishnv (Sexton) on Apr 26, 2020 at 13:36 UTC

    The error is "couldn't copy file No such file or directory at C:\sandboxes\Scripts\dummy.pl line 9."

      I suggest changing the error message like hippo advised here
      "couldn't copy file '$source' to '$target': $!";
      and perhaps count the backslashes.

      If you are convinced the path/filename is correct, can you replace the copy with syscopy to make use of Win32::CopyFile via Win32API? Which version of Perl are you running?

        Perl512 I used syscopy, got this error "Undefined subroutine &main::syscopy called at .."

Re^4: File name is long to copy
by harishnv (Sexton) on Apr 26, 2020 at 13:38 UTC

    Windows 10 and the file is present because there are other files which I copy in that directory

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11116079]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2024-04-23 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found