Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Files Question.

Status
Not open for further replies.

Milleniumlegend

IS-IT--Management
Joined
Dec 16, 2003
Messages
135
Could you please let me know what is the difference between

Command 1
copy ("$srcbin/$file\.lst)","$binfolder") or print "Copy Failed for $file.lst: $!\n";

Command 2

copy ("$srcbin/$file*)","$binfolder") or print "Copy Failed for $file: $!\n";

I have a basename for the file and try to copy the files to another destination. If I do explicitly define the file extensions it works if I use a wild card like a * it would complain.

Code:
Copy Failed for TEST-SETUP.lst: No such file or directory
 
the asterisk in that context has no speacial signifigance, it's just an asterisk. Also, the syntax doesn't even look correct, you have an unbalanced number of parenthesis, looks like the code shouldn't even run. You also don't need to escape a dot in that context either, should be:

copy ("$srcbin/$file.lst",$binfolder) or print "Copy Failed for $file.lst: $!\n";


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top