

And, you can even modify this creation time via the Windows API. It merely tracks when the directory entry was created which is sort of what ctime does.

What if I copy the file? Should the new copy have a new creation time? What if I did a copy, then deleted the original? What if I edited a file? How about if I changed everything in the file with my edit? Or I edited the file, then renamed it to a completely new name?Įven on Windows that has a file creation time, doesn't really track the file creation. Why no creation time? Because how would you define it? What if I move a file? Should there be a new creation time (By the way, ctime won't change with a move). This is the name of the user, the size of the file, the device it's on, the link count, and ironically, the mtime, atime, and ctime timestamps. This includes the various things you see when you take the Perl stat of a file. In Unix, certain file information is stored in the inode.
#Qq mac 10.7.5 code
You can customize the sorting order by providing a subroutine or code block to the sort function. Opendir(DIR, $ARGV) #open directory for getting file list My $usage = "usage: enter name of directory to be scanned for SNP containing lines\n" Use File::stat # helps with sorting files by ctime, the inode date that hopefully can serve as creation date In response to an answer, here is another version of the script that attempts to sort the files: #!/usr/bin/perl I know that in the Finder, there is a sort by creation date option, so there must be some kind of indication for date of creation somehow attached to files in this system. In response to an edit, I should say I use Mac, OS 10.7. My = "sort-by-date-created" (readdir(DIR)) ĭo things with CPAN has a page on the sort command, but it's not very accessible to me, and I don't find the words "date" or "creation" on the page.

There is some previous postings on sorting by creation date in other languages other than Perl, such as php or java.įor example, I need to do the following: opendir(DIR, $ARGV) I assume this is a more common need than sorting by date of creation. I can find some discussion, using tags for Perl, sorting, and files, on sorting files based on date of modification.
