Results 1 to 7 of 7
  1. #1


    Member Since
    Apr 09, 2014
    Posts
    15
    Thumbs up Smallest File Finder
    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?

  2. #2

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,742
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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?
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3

    pigoo3's Avatar
    Member Since
    May 20, 2008
    Location
    U.S.
    Posts
    33,302
    Specs:
    2011 13" MBP 2.3ghz, 8gig ram, OS 10.8.5
    Quote Originally Posted by faisaliqbal View Post
    Tell me some ideas how to do it?
    If I told you...then I wouldn't get rich & famous!

    - Nick
    - Too many "beachballs", read this: Beachballs
    - Computer seems slower than it used to? Read this for some slow computer tips: Speedup
    - Almost full hard drive? Some solutions. Out of Space
    - Apple Battery Info. Battery

  4. #4

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,742
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    You can leverage the command line for this one. Try adapting this to your needs.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  5. #5

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,345
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3
    It's fairly simple..
    Code:
    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
    Now read up on the API and implement..
    --
    Regards
    ...Ashwin



    Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.

  6. #6


    Member Since
    Apr 09, 2014
    Posts
    15
    Quote Originally Posted by vansmith View Post
    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?
    reply: i am using objective-c language and trying to find smallest file in complete file system.

  7. #7

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,742
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Raz0rEdge's psuedocode ought to get you started. This might also help.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 07-20-2015, 05:50 AM
  2. Replies: 1
    Last Post: 02-28-2010, 12:05 PM
  3. Smallest font in Microsoft Office 2004
    By Thundermoon1994 in forum OS X - Apps and Games
    Replies: 1
    Last Post: 03-03-2008, 04:49 PM
  4. World's smallest political quiz...
    By Geeky1 in forum Schweb's Lounge
    Replies: 22
    Last Post: 10-28-2007, 02:00 PM
  5. Smallest, newer mac???
    By jeb in forum Apple Notebooks
    Replies: 14
    Last Post: 08-08-2007, 02:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •