Need help to list the updated file in a directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rupakanto
    New Member
    • Sep 2006
    • 1

    Need help to list the updated file in a directory

    Hi

    Can u help me in writing the below function in perl under windows

    > We have some n number of files in a dir ( eg : 10 .txt files)
    > In that abc.txt is latest modified

    Now i would like to list the file name of the last moddified using a fucntion by filtering the other files

    Pls can anyone help mi out inthis..

    under windows

    Thanks in advance
  • viviandanga
    New Member
    • Sep 2006
    • 1

    #2
    From: Miss Vivian Danga
    Abidjan Cote d'Ivoire .
    Email:vivian_da nga@yahoo.fr

    Dear One,

    I am Miss Vivian Danga the only Daughter of late Mr, Richard Danga the former rebel sponsor leader in Bouake west cost of cote d i'voire .I discoverd that my father deposited the sum of the sum of (10,800 000) Ten million eight hundred Thousand Million USA dollar in a security here in cote d' Iviore ,and now I am in hiding in one of the cities in Abidjan called Yopougoun due to infertility nature of my country politically.

    I wish to invest this money in your country. I also plead you help me on the investment part of the business; you have a free hand of operation.

    I will like you to send me your telephone number,I will send you the name of the security firm for you to open contact with them for withdrawal of the consignment to move it to your country for investment.

    The money is in the position of a security company as a family treasure.

    A legal process will take place to ensure mutual transfer.
    All effort made to the successful of this transaction will highly be appreciated. I hope to get a favourable reply in due curse.

    We can negotiate on the terms of assistance.

    please email me back with my private id (vivian_danga@y ahoo.fr)

    Best regards,

    Miss Vivian Danga

    Comment

    • robin
      New Member
      • Sep 2006
      • 6

      #3
      Ms Danga's kind offer aside, you can get the file list for a directory as follows

      @a = <C:/path/to/file>;

      Then...

      for each instance of $a[..] you can get the date last modified as follows

      open(HANDLE, $a[..]);

      my $date = localtime( (stat HANDLE)[9] );

      close HANDLE;

      So just whack that in a for loop and find the last modified

      the [9] is from this list

      0 dev device number of filesystem
      1 ino inode number
      2 mode file mode (type and permissions)
      3 nlink number of (hard) links to the file
      4 uid numeric user ID of file's owner
      5 gid numeric group ID of file's owner
      6 rdev the device identifier (special files only)
      7 size total size of file, in bytes
      8 atime last access time since the epoch
      9 mtime last modify time since the epoch
      10 ctime inode change time (NOT creation time!) since the epoch
      11 blksize preferred block size for file system I/O
      12 blocks actual number of blocks allocated

      Comment

      Working...