in reply to Rename Uploaded Files

Thank you all for your help so far. For now I have sttlled on something like:
do{ $create = -C "test1.jpg"; $modify = -M "test1.jpg"; }until ($create == $modify and $create > 0); # Then process file or whatever.....
I tried several things such as code I found here at the monestary to monitor the windows process list like so:
use Win32::PerfLib; sub get_remote_process_list { my $server = $_[0]; my %rtasks; my %counter; Win32::PerfLib::GetCounterNames($server, \%counter); my %r_counter = map { $counter{$_} => $_ } keys %counter; my $process_obj = $r_counter{Process}; my $process_id = $r_counter{'ID Process'}; my $perflib = new Win32::PerfLib($server); my $proc_ref = {}; $perflib->GetObjectList($process_obj, $proc_ref); $perflib->Close(); my $instance_ref = $proc_ref->{Objects}->{$process_obj}->{Instance +s}; foreach my $p (sort keys %{$instance_ref}){ my $counter_ref = $instance_ref->{$p}->{Counters}; foreach my $i (keys %{$counter_ref}){ if($counter_ref->{$i}->{CounterNameTitleIndex} == $process +_id){ print "$instance_ref->{$p}->{Name} "; $rtasks{$counter_ref->{$i}->{Counter}} = $instance_ref +->{$p}->{Name}; } } } return %rtasks; }
But I never saw a new Process appear in the list when someone was uploading so I had no idea what to monitor. Btw, I am testing this on my local network using WSFTP to send a file to a second computer. I also tried something like:
use Win32::Process; use Win32; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } Win32::Process::Create($ProcessObj, "C:/WINNT/system32/CMD.EXE", "dir", # p +rint dir just to see if I can do anything at all 0, CREATE_NEW_CONSOLE, ".")|| die ErrorReport(); $ProcessObj->Wait(INFINITE);
because the shell acting like I wanted as far as renaming went, but I never could sent any commands to the new "Dos" window. frustrating......

Replies are listed 'Best First'.
Re: Re: Rename Uploaded Files
by Anonymous Monk on Dec 02, 2002 at 21:55 UTC
    do{ $create = -C "test1.jpg"; $modify = -M "test1.jpg"; }until ...
    My CPU usage is spiking, just looking at that. Put a sleep 1; inside the loop to cool it off.