Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Get all files in directory that are more than 7 days old

Expand Messages
  • Jeff 'japhy' Pinyan
    ... There s a big difference between $dir/$file and $dir/$file One is a string of $dir, / , and $file. The other is the division of the value of $dir by
    Message 1 of 8 , Aug 31 4:50 PM
    • 0 Attachment
      On Aug 31, Priss said:

      >> Shouldn't that be testing for the full path
      >> ("$dir/$file") to the file?
      >
      >For some reason, it didn't like:
      >
      >if (-M $dir/$file > $days)

      There's a big difference between

      "$dir/$file"

      and

      $dir/$file

      One is a string of $dir, "/", and $file. The other is the division of the
      value of $dir by the value of $file.

      --
      Jeff "japhy" Pinyan japhy@... http://www.pobox.com/~japhy/
      RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
      ** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
      <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
      [ I'm looking for programming work. If you like my work, let me know. ]
    • Nathan.Jeffrey@dhs.vic.gov.au
      Well, you could do with a Unix find command... find . -mtime +7 Or, in perl, you could do it... perl -e print -M /etc/passwd The -M file test operator
      Message 2 of 8 , Sep 1, 2002
      • 0 Attachment
        Well, you could do with a Unix find command...

        find . -mtime +7

        Or, in perl, you could do it...

        perl -e 'print -M "/etc/passwd"'

        The '-M' file test operator returns the number of days (to 13 decimal
        places, in 5.8.0) since the file was modified. See also '-A' and '-C'.

        N





        Priss <priss_uk_2000@...>
        31/08/2002 08:14 PM
        Please respond to perl-beginner


        To: perl-beginner@yahoogroups.com
        cc:
        Subject: [PBML] Get all files in directory that are more than 7 days old


        Hiya,

        Is there a way to get those files in a directory that
        are more than 7 days old? (last modified is more than
        a week ago)

        Many thanks in advance...

        Priss

        __________________________________________________
        Do You Yahoo!?
        Everything you'll ever need on one web page
        from News and Sport to Email and Music Charts
        http://uk.my.yahoo.com


        Unsubscribing info is here:
        http://help.yahoo.com/help/us/groups/groups-32.html

        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/







        _________________________________________________________________________________

        This email contains confidential information intended only for the person named above and may be subject to legal privilege. If you are not the intended recipient, any disclosure, copying or use of this information is prohibited. The Department provides no guarantee that this communication is free of virus or that it has not been intercepted or interfered with. If you have received this email in error or have any other concerns regarding its transmission, please notify Postmaster@...
        _________________________________________________________________________________
      Your message has been successfully submitted and would be delivered to recipients shortly.