![]() I checked that the variables are working right with the commented out print statements, but when I run the program I get a message that says "Cannot rename file: Invalid argument at line 13." I'm not sure what I'm doing wrong here. Basically, I want to write a script that when run performs a specific action if any file inside any one of a set of directories has been changed after a given point in time, and need to come up with a way to detect. ![]() Rename $oldfile, $newfile or die "Cannot rename file: $!" Im not really interested in which specific file is newer than the timestamp, only whether or not any such files exist at all. How do I get a file's timestamp in perl If you want to retrieve the time at which the file was last read, written, or had its meta-data (owner, etc) changed, you use the -M, -A, or -C filetest operations as documented in the perlfunc manpage. Many programs do use epoch for log entries. ![]() Of course all of those guesses might be wrong - it depends a lot on what application created the log entry. ![]() The 105 may be an internal log sequence number. Opendir(DIR, $dirnam) or die "Cannot open directory: $!" So if that is epoch then the message occurred today at 8:10:56 (AM). Perl: Get time-stamp of a file and check is this today or not. I'm very new to perl, and I want to rename a group of files so that they are lowercase instead of uppercase (so from SBC005.wav -> sbc005.wav). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |