WinNT: getting File Last Modified data from outside current directory 
Author Message
 WinNT: getting File Last Modified data from outside current directory

I'm attempting to do file synchronization of about five directories from one
NT machine to another, and discovered something odd in the process.

Using something like print ("-M $filename") for a list of files in the
currently logged directory gives the appropriate number of days since last
modification of all files in that directory.

Using the same function on files in any other directory gives null values.

system("cd <otherdirectory>"), which under UNIX would move me to the
appropriate directory as a way around this, doesn't seem to work under NT.

I'm trying to only update those files which have been modified since the last
"sweep" of the program, which will be run continuously as a service with
various "time out" intervals for different directories.

Assistance would be appreciated.

TIA,

Loren

--
Loren Davidson      

The 3 in the header is silent...and a SPAM filter
"The future isn't what it used to be" -- Amb. G'Kar



Fri, 05 Nov 1999 03:00:00 GMT  
 WinNT: getting File Last Modified data from outside current directory

Quote:

> system("cd <otherdirectory>"), which under UNIX would move me to the
> appropriate directory as a way around this, doesn't seem to work under NT.

It does, but it does it in a subprocess, which doesn't do your process
much good, as your scripts context remains in the same directory where
it was when you called the system function.

Look in perlfunc for the chdir function instead (and in case you depend
on other non-portable system utilities, that have a portable equivalent
in the language or CPAN modules, then look into changing those as well).

regards,

    ICL Data Oy
    Finland



Sun, 07 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Change Last Modified for all files in a directory

2. better way of getting the last modified file?

3. Getting the last date modified

4. Directory Last Modified

5. Getting current working directory

6. Getting the current directory path/name

7. Getting Current Directory info

8. Getting current working directory in perl script

9. Get last modified date of file?

10. PERLFUNC: utime - set a file's last access and modify times

11. PERLFUNC: utime - set a file's last access and modify times

12. date file last modified check?

 

 
Powered by phpBB® Forum Software