LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 05-10-2009, 02:51 PM   #1
Kunsheng
Member
 
Registered: Mar 2009
Posts: 82

Rep: Reputation: 16
Sort files under a folder by created date


Could anyone giving me some idea on how to sort files under a folder by created date in C (pure c)?

I know how to output all files under a certain folder using DIR structure. The thing is I want them to output in an order by created date.

I am wondering if there is any other way besides writing a sort method myself.



Thanks,

-Kunsheng
 
Old 05-10-2009, 03:16 PM   #2
kellinwood
Member
 
Registered: Jan 2006
Location: Culver City, California
Distribution: Fedora
Posts: 64

Rep: Reputation: 21
You can sort using Glib's GTree (balanced binary tree). http://library.gnome.org/devel/glib/...ary-Trees.html

You might need to install the package 'glib-devel' first, though.
 
Old 05-11-2009, 02:20 AM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.2, Centos 5.8
Posts: 11,740

Rep: Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905
just FYI, there's no such thing as creation time in *nix eg see man find
 
Old 05-11-2009, 04:58 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,123

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
man 3 qsort
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find out the files created on a particular date. ZAMO Linux - General 3 02-08-2008 01:38 AM
How to - list files that were created aftre certain date kaprasanna Linux - Newbie 2 12-10-2007 03:50 AM
bash sort files by date in file name thedude2010 Programming 6 05-12-2006 11:07 AM
Date interrogation for files created chunky Linux - General 2 08-03-2004 03:31 PM
How to sort files in a directory by date in KDE? Ace_Azzameen Linux - Software 7 05-24-2004 02:49 PM


All times are GMT -5. The time now is 05:25 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration