Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: check for latest file, remove and touch file?

by GotToBTru (Prior)
on Jan 07, 2016 at 15:48 UTC ( [id://1152201]=note: print w/replies, xml ) Need Help??


in reply to Re^2: check for latest file, remove and touch file?
in thread check for latest file, remove and touch file?

At least in my environment (AIX), opening the file in append mode without adding any content does not update the modification date of the file.

$: date Thu Jan 7 09:37:01 CST 2016 $: touch step.file $: ls -l step.file -rw-r--r-- 1 wlsedi wlsedi 0 Jan 07 09:37 step.file $: date Thu Jan 7 09:38:01 CST 2016 $: touch step.file $: ls -l step.file -rw-r--r-- 1 wlsedi wlsedi 0 Jan 07 09:38 step.file $: date Thu Jan 7 09:39:38 CST 2016 $: perl -de 1 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 1 DB<1> open $fh,'>>','step.file' DB<2> close $fh DB<3> q $: ls -l step.file -rw-r--r-- 1 wlsedi wlsedi 0 Jan 07 09:38 step.file

Opening in write does have the un-touchlike side effect of wiping out any content. In this particular instance, that is of no consequence, but using the code as a generic replacement for touch is problematic.

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Replies are listed 'Best First'.
Re^4: check for latest file, remove and touch file?
by mr_mischief (Monsignor) on Jan 12, 2016 at 20:46 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1152201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-19 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found