- Joined
- Apr 9, 2014
- Messages
- 15
- Reaction score
- 0
- Points
- 1
I am new to mac, I am trying to build a app which can display the smallest file in the system. Tell me some ideas how to do it?
Tell me some ideas how to do it?
In psuedo code:
Create data structure to hold
size
name
directory
Open a directory
Create instance of data structure and initialize to empty/NULL
Get first entry
Is it a directory?
Recursively call yourself
Is it a file?
Determine the size of the file
Is the data structure empty?
Save all information of file in data structure
Go to next file
Compare size of this file to data structure data
Is this file smaller?
Overwrite all information in data structure
Go to next file
Go to next file
Close directory
Moved to more appropriate forum.
Can you be a little more specific? Are you looking for all files or only files from a certain location on the filesystem? What language are you using?