in reply to Re: (nrd) How long have you been sitting on my server?
in thread How long have you been sitting on my server?

Why don't you walk over the directories in your webserver and check each file using the last modified file test operator?

The last modified test operatior (-M) is exactly what I am using. I am sorry that I confused this with the age of the file. The problem is that a file could have been modified months ago, and when the file gets upload to the server, its last modified time doesn't change. I need to know how long the file has been on the server, not the last time it has been modified or accessed.

  • Comment on Re: Re: (nrd) How long have you been sitting on my server?

Replies are listed 'Best First'.
Re^3: (nrd) How long have you been sitting on my server?
by newrisedesigns (Curate) on Jan 27, 2003 at 20:11 UTC

    What FTP server/operating system do you use?

    I have a "last updated" script on my server. It checks a few directories for HTML files and sorts them according to the return value of -M. If I upload a file using FTP to my server, the value returned from -M is set to the time of the upload. I just tested this on my server using a HTML file that was two months old. It shows up first in the list, being updated "0 seconds ago" (upon reload of the CGI script).

    I'm pretty sure that a file uploaded sets it's last modified value to whatever the time of upload was. If the file was copied to the FTP directory using your operating system and not via FTP, I can see how -M wouldn't work.

    Hope this helps.

    John J Reiser
    newrisedesigns.com