473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Sorting files

Can anyone tell me how to sort the list of files on the basis of creation time and date of file?
May 24 '07 #1
4 2108
miller
1,089 Expert 1GB
Hi Sada,

All you need is the following functions:

perldoc stat
perldoc -X
perldoc sort

Expand|Select|Wrap|Line Numbers
  1. my @sorted = sort {(stat($a))[9] <=> (stat($b))[9]} @files;
  2.  
- Miller
May 24 '07 #2
KevinADC
4,059 Expert 2GB
Can anyone tell me how to sort the list of files on the basis of creation time and date of file?

Miller has posted the functions you can use to do this, but what do you mean by:

"creation time and date of file"

what is "date of file"?
May 24 '07 #3
Miller has posted the functions you can use to do this, but what do you mean by:

"creation time and date of file"

what is "date of file"?
Hi Kevin,

what is "date of file"?

---->The date and the time when the file was created.

Regards,

Sadanand
May 25 '07 #4
KevinADC
4,059 Expert 2GB
OK, I gotcha now. Millers suggestion will do that for you.
May 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Paul | last post by:
Hi all I have a sorting problem, but my experience with Python is rather limited (3 days), so I am running this by the list first. I have a large database of 15GB, consisting of 10^8 entries...
1
by: yabba | last post by:
For one of my pages I use fso to create a list of available files. Does anyone know of a way to sort the files BEFORE making the list? ie. similar to clicking on one of the headers in explorer....
0
by: Mike Carter | last post by:
I'd like to sort a directory of files by the "Date Picture Taken" column that appears for digital camera images in Explorer. How do I access this file property in code and is there a way to have...
4
by: Niels | last post by:
Hello, I want to make a program that moves files from a main directory to a sub directory. Suggeset that i have 2000 files, the program will create 4 sub directory's and move 500 files to each...
3
by: ILMergeHelp | last post by:
Hi All, I have an application similar to windows explorer. The problem now is that am not able to sort the folders and files windows explorer style i.e. Ex All folders are sorted in alpha order...
1
by: Amjad | last post by:
I want to sort files in a specified folder by their creation date and then display their names (sorted by the creation date) in a textbox for example. How would you do that? Dim dir As New...
13
by: Randall Arnold | last post by:
I'm not happy with the order in which OpenFileDialog retrieves multiple selected files. I want them in Date order, oldest to newest, but by default they come in by filename, last to first. The...
3
by: pramodkh | last post by:
Hi All, I have a remote directory wherein some files will be generated. I am writting a PERL script in windows to get the latest file created in that directory.How do i achieve this? This is...
3
by: lion cave | last post by:
Hello, I would like to ask on how to sort files by date modified and displaying the top 20 latest date. Heres, my sample function that would return the files to be displayed function...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.