in reply to Re: Server access denied when checking for files
in thread Server access denied when checking for files
#!/usr/bin/perl $dirtoget="\\\\Server\\Bankpro"; #directory to +read folders opendir(IMD, $dirtoget) || die("Cannot open directory"); #o +pen directory @thefiles= readdir(IMD); #store all files a +nd folders in directory into an array closedir(IMD); #close directory open (filenames, "dissmissed2.txt") || die ("Could not open file. <br> + $!"); #open list of file names $text = <filenames>; #read in one line +from txt file $defaultdir = "\\\\Server\\Bankpro"; # Directo +ry containing original folders $destinationdir = "\\\\Server\\BPdismis"; # Direct +ory to copy folders to foreach $f (@thefiles) #for each file i +n the directory { unless ( ($f eq ".") || ($f eq "..") ) #dont move + unless its a file of folder { while ($text){ #while there is a li +ne of text $text =~ s/\s+$//; #strip off whitesp +ace, newline and tabs system qq(move /y "$defaultdir/$text" "$destinationdir"); +#move files to diffrent directory $text = <filenames>; #read in next +line from file } } } close (filenames); #close list of files
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Server access denied when checking for files
by jhourcle (Prior) on Apr 26, 2005 at 01:20 UTC | |
by bobdole (Beadle) on Apr 26, 2005 at 02:31 UTC | |
by jhourcle (Prior) on Apr 26, 2005 at 13:21 UTC | |
|
Re^3: Server access denied when checking for files
by chas (Priest) on Apr 26, 2005 at 03:00 UTC | |
|
Re^3: Server access denied when checking for files
by wazoox (Prior) on Apr 26, 2005 at 09:40 UTC |