changing the date/time stamp

Discussion in 'Perl Misc' started by monk, Feb 26, 2008.

  1. monk

    monk Guest

    Is there a "perl way" of modifying the date/time stamp of a file? Is
    there a core function or core module I'm overlooking?

    I guess I'd like to emulate or find the equivalent of the 'touch'
    command without using system ('touch...')

    # from the shell, modify xfile creation date to year 2001 January day
    30 time 13:50:26
    touch -t 200101301350.26 xfile


    thanks in advance.
     
    monk, Feb 26, 2008
    #1
    1. Advertising

  2. monk <> writes:

    > Is there a "perl way" of modifying the date/time stamp of a file? Is
    > there a core function or core module I'm overlooking?


    See the documentation of the utime function in perlfunc.

    //Makholm
     
    Peter Makholm, Feb 26, 2008
    #2
    1. Advertising

  3. monk

    monk Guest

    just what the doctor recommended.

    you da man!! thanks.
     
    monk, Feb 26, 2008
    #3
  4. monk <> wrote:
    > Is there a "perl way" of modifying the date/time stamp of a file? Is
    > there a core function or core module I'm overlooking?



    perldoc -f utime


    > # from the shell, modify xfile creation date to year 2001 January day

    ^^^^^^^^^^^^^
    > 30 time 13:50:26
    > touch -t 200101301350.26 xfile



    touch does NOT modify the creation date, because there is no
    such thing on most *nix filesystems...


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
     
    Tad J McClellan, Feb 27, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmVydA==?=

    Date/Time stamp in SQL

    =?Utf-8?B?QmVydA==?=, Jan 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    21,511
    Wardeaux
    Jan 30, 2004
  2. srini
    Replies:
    9
    Views:
    11,750
    Beauregard T. Shagnasty
    Apr 14, 2004
  3. mark | r

    time and date stamp - start stop button?

    mark | r, Nov 30, 2005, in forum: ASP General
    Replies:
    3
    Views:
    163
    mark | r
    Nov 30, 2005
  4. Brave
    Replies:
    3
    Views:
    898
    Brave
    Jul 25, 2009
  5. Dr John Stockton

    Appending Date/Time Stamp to filename

    Dr John Stockton, Sep 26, 2004, in forum: Javascript
    Replies:
    0
    Views:
    144
    Dr John Stockton
    Sep 26, 2004
Loading...

Share This Page