but it will work like this$oldtime = 1043205456; $filename = /share/shared/path/somepath/doc with space.doc; utime ($oldtime, $oldtime, "$filename");
So finally this is the perl for setting a bunch of docs with spaces as root in unix.chdir("/share/shared/path/somepath"); $filename = doc with space.doc; utime ($oldtime, $oldtime, "$filename");
this is a snippet from the file it reads the values from#!/usr/bin/perl -w open(CSV, "/tmp/doctime.txt"); #contains comma seperated path,filename +,olddate @title = <CSV>; # I know this is lame but it works and I understand it for ($i = 0; $i < scalar(@title); $i++) { # some of you dont like this but it works fine ($dironly[$i], $filename[$i], $date[$i]) = split(",", $title[$i]); + } for ($a = 0; $a < scalar(@filename); $a++) { $access= $date[$a]; $file = $filename[$a]; $dir = $dironly[$a]; chdir("$dir"); print "$dir $file $access\n"; #use this for a log print utime ($access, $access, "$file"), "\n"; }
Results mean more than tidy code <G> (still tidy code would be nice). Three scripts, one to record all dates, one to change the document properties of office docs, one to set the dates back (as the second script makes all file dates the present)./staff/cy/share/shard/cr,MS_CR_New diensions server.xls,1020001208 /staff/cy/share/shard/cr,MS_CR_keon route modification 180902.xls,1044 +234302 /staff/cy/share/shard/cr,MS_CR Key route addition001.xls,1044234302 /staff/cy/share/shard/cr,CY_CR_Memory upgrade.doc,1034234102
In reply to Re: spaces in filenames
by ironpaw
in thread spaces in filenames
by ironpaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |