Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Get file timestamp for a file in a directory

by steves (Curate)
on Nov 26, 2004 at 19:28 UTC ( #410620=note: print w/replies, xml ) Need Help??


in reply to Get file timestamp for a file in a directory

Yes, your use of Time::localtime is the key. It overrides the built-in localtime. If you use the built-in, it returns a ctime(3) like string. But in either case, a ctime string isn't going to give you that 2004111622 format in most cases. To get a specific date format, you'd also want to incorporate something like a call to the POSIX strftime function.

I can't tell for sure, but it looks like you may also be trying to stat the base file name only: since you open the directory, you'd need to prepend the directory. Otherwise it will only work if you run it from that directory.

  • Comment on Re: Get file timestamp for a file in a directory

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://410620]
help
Chatterbox?
[choroba]: That still doesn't make it offensive
[LanX]: of course not
[LanX]: it's pretty ironic if you know the character
choroba likes the movie
[choroba]: Lady_Aleena Do you really need to say "WorldBuilder" after having said "WorldBuilding"?
[LanX]: have to watch it again :)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2017-05-24 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?