in reply to Copy from the curent directory to...
You are kidding right? Try this (you type it at the command prompt - Start|Run|cmd.exe):
C:\>copy /? Copies one or more files to another location. COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. destination Specifies the directory and/or filename for the new fil +e(s). /V Verifies that new files are written correctly. /N Uses short filename, if available, when copying a file +with a non-8dot3 name. /Y Suppresses prompting to confirm you want to overwrite a +n existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless COPY command is being executed from within a batch script. To append files, specify a single file for destination, but multiple f +iles for source (using wildcards or file1+file2+file3 format). C:\>
So to do it just type (say this) at the command prompt:
copy blabla.jpg c:\games copy .\*.jpg c:\all_jpegs
The DOT dir is the current dir and * is a wildcard that matches anything so .\*.jpg means match anything in the current directory that ends in .jpg. You can call shell from perl like this using backtics
#!/usr/bin/perl `copy blabla.jpg c:\\games`;
NOTE you need 2 backslashes everyhwere you want a single backslash because of the special nature of the \ char in strings ie \n is a newline and \\ is a literal backslash.
You can also use the File::Copy module which has the advantage of working across operating systems although somehow I don't see that as a likely issue for you.
<code>#!/usr/bin/perl use File::Copy; copy( 'file1', 'file2' );
cheers
tachyon
|
|---|