How to count all files inside a disk?

Hi,
is there any free app to count all files inside a hard disk or volume without open all volumes and folders?
Not the size, but the number of files.
Thank you very much.

Disk Utility displays a full drive folders and files
Finder with Show Status Bar, displays folder items at the bottom the Finder window
Do you require further information than these?

Similar Messages

  • How to Read all files inside resource Folder inside Jar?

    I have a Jar file,,,, The program reads for resource files in the resource folder inside the Jar. I want my program to read all files inside this folder without knowing the names or the number of files in the folder.
    I am using this to make an Applet easy to be updated with spicific files. I just want to add a file inside the resource folder and Jar the program and automatically the program reads what ever is in there!!
    I used the File class to get all file names inside the resource folder. it works fine before Jarring the program. After I jar I recieve a URI not Herarichy Exception!!
    File fold=new java.io.File(getClass().getResource(folder).toURI());
    String[] files=fold.list();
    I hope the question is clear!!

    How to get the directory and jar file that you class resides in:
    // returns path and jarfile (ex: /home/mydir/my.jar)
    public String getJarfileName()
            // Get the location of the jar file and the jar file name
            java.net.URL outputURL = YourClass.class.getProtectionDomain().getCodeSource().getLocation();
            String outputString = outputURL.toString();
            String[] parseString;
            int index1 = outputString.indexOf(":");
            int index2 = outputString.lastIndexOf(":");
            if (index1!=index2) // Windows/DOS uses C: naming convention
               parseString = outputString.split("file:/");
            else
               parseString = outputString.split("file:");
            String jarFilename = parseString[1];
           return jarFilename;
    }If your my.jar was in /home/mydir, it will store "/home/mydir/my.jar" in jarFilename.
    note: getLocation returns "file:/C:/home/mydir/my.jar" for Windows/DOS and "file:/home/mydir/my.jar" for windows, thus why I look for the first and last index of the colon so I can correctly split the string.
    If you want to grab a file in the jar file and get an InputStream, do the following:
    import java.io.*;
    import java.util.Enumeration;
    // jar stuff
    import java.util.jar.*;
    import java.util.zip.ZipEntry;
    public class Jaris
       private JarFile jf;
       public Jaris(String jarFilename) throws Exception
           try
                           jf = new JarFile(jarFilename);
           catch (Exception e)
                jf=null;
                throw(e);
       public InputStream getInputStream(String matchString) throws Exception
           ZipEntry ze=null;
           try
              Enumeration resources = jf.entries();
              while ( resources.hasMoreElements() )
                 JarEntry je = (JarEntry) resources.nextElement();
                 // find a file that matches this string from anywhere in my jar file
                 if ( je.getName().matches(".*\\"+matchString) )
                    String filename=je.getName();
                    ze=jf.getEntry(filename);
          catch (Exception e)
             throw(e);
          InputStream is = jf.getInputStream(ze);
          return is;
       // for testing the Jaris methods
       public static void main(String[] args)
          try
               String jarFilename=getJarfileName();
               Jaris jis = new Jaris(jarFilename); // this is the string we got from the other method listed above
               InputStream is=jis.getInputStream("myfile.txt"); // can be used for xml, xsl, etc
          catch (Exception e)
             // this is just a test, so we'll ignore the exception
    }Happy coding! :)
    Doc

  • 10.6.4:  how to unlock all files in a folder

    hi,
    how do you unlock all files inside a folder?
    thank you..

    thank you.. (I wonder why you can't just do it by getting info on the folder, then saying, unlock all files inside.. (u can do like that in windows) this is always more practical than having to select all files (and accidentally opening them, or something...-) in windows you can select a folder and then say, (un)lock all files and and dirs -- and subdirs and files inside -- inside this folder.. can u do something like this in mac os? if not, that's not very good.. (I guess on the mac would need to find unix commands for doing something like this..)
    they really need to consider this for future versions, this is a no-brainer...;-)
    thank you..

  • How to select all files in a stack? Control-click doesn't work

    how to select all files in a stack? Control-click doesn't work

    Switch to list or column view. If you must use icon view, instead of Shift-clicking items, click on an empty space near one of them and drag to enclose them.
    (119467)

  • Build Applicatio​n with all files inside .exe

    Hello,
    I have a labview project consisting of a few classes and subvi's. Nothing really special. Now when i try to build an .exe file, i get the .exe, an application.ini, an Application.aliases and an data folder (has the classes and dll's within). What i want however is the .exe file with all files inside. So that at the test setup, there is only one file on de dekstop, and not 4. Is it possible to do that?
    Greetings wcm 

    LabVIEW 2009 and later have a build option (set on per default) that embeds all the classes inside the executable file.
    The ini file will always be created, however you can delete it during startup of your executable.
    I think you don't need the data folder since that has some DLL already present on your system.
    However my advise is to create an installer that puts the executable (and the other files) inside the program files folder. And the installer can create a shortcut to the executable.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • How to generate PNG file to the disk folder by IBOT?

    Is there a piece of code in JavaScript on how to generate PNG file to the disk folder by IBOT?
    thanks a lot

    Please disregard this message. The information below is only semi-accurate. When I get some kinks worked out I'll edit this again. -Bill
    FYI,
    Don't really know if I'm adding anything useful but here it is. I use NetBeans and I simply added an images folder so now I have my package (deckofcards) and a sub package deckofcards.images.
    The image:
    back: Image {
                url: "{__DIR__}images/B.JPG",
                backgroundLoading:true
                placeholder:bind placeholder
            };works and the value of "{__DIR__}images/B.JPG" becomes
    <CARD backUrl="jar:file:/C:/Users/Bill/Documents/NetBeansProjects/DeckOfCards/dist/DeckOfCards.jar!/deckofcards/B.JPG">
      ...when I marshal. That string (backUrl) will unmarshal correctly and can be use in the url variable to display and image too.
    -Bill
    Edited by: bthayer on Feb 21, 2009 6:04 AM

  • How to select all files in "user dir" (LastAccessedDirectrory) using applet

    Hi,
    Can anyone tell me " How to select all files in "user dir" (Last Accessed Directrory) using applet"?
    For this which method in applet used?
    Thanks in Advance.

    1) Do you want "user dir" (watever that is) or do you wnat the last accessed directory? Last accessed by what/whom?
    2) Applets can't access the local file sytem, and for good reason, unless they're signed and the client has given permission.

  • File Dialog - How to remove all files pattern in LV 8.x

    How to remove "all files" pattern in LV 8.x in the file dialog.
    Is it possible?
    Thanks
    Dany
    Dany Allard

    If it is a security issue, you will probably need to implement a custom dialog and actively filter for file types.  No matter what pattern you have showing, the user can type a pattern into the dialog and get anything they want.  In addition, file extension is not sufficient to determine file type.  You should probably check the file itself to ensure it is an HTML file and does not have any embedded nastiness.
    Fortunately, custom dialogs are easy to make.  Using the event structure, you can filter inputs as well, so that only HTML files will be accepted.  Good luck.  Let us know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to bundle all files and directories in a package?

    how to bundle all files and directories in a package?
    i plan to put all image files, .class files and some other files together.and then double click the package to execute the program.
    should i use jar?is there a link for tutorial or example?
    thanks in advance

    http://java.sun.com/docs/books/tutorial/jar/

  • How to move all files but X to Y

    It doesn't really matter if it's in the terminal or if it's a applescript but I need to know how to:
    Move all files in a dictionary but a few named.

    Could you pleas explain more?
    If you do not understand the shell while loop, it is possible that using shell commands is a bit more dangerous than you might want to try.
    The explanation:
    ls -a | grep -v "X" | while read file
    do
        mv "$file" "Y/"
    done
    ls -a will list all the files in the current working directory (including the invisible files that start with a leading period.  Thinking about this, maybe you do not want to include -a.  You could cd /path/to/the/desired/directory as a way to set your current working directory as the directory you wish to move things from
    cd "/path/of/the/from/directory"
    ls | grep -v "X" | while read file
    do
        mv "$file" "Y/"
    done
    The ls command's output is piped (the vertical bar | ) into the grep command (general regular expression parser).  The -v option tells grep to throw away any lines (filenames) that match the regular expression "X".  So if the regular expression X matches all the files you do not want to move, the filenames send to the next pipe will be the files you wish to move.
    The while loop will read the filenames grep has selected and invoke the mv (move) command for each file selected by grep and move them to the destination directory Y
    The bigest risk is that you will execute this in the wrong directory and move the files that you need somewhere else.  OR WORSE, if "Y" is NOT a directory, and you DO NOT put a trailing / the mv could move easy file to the destination file, deleting the previous file for each file moved, so effectively deleting every file in the directory except the last one.
    This is why I said if you do not understand what is going on with the shell commands, you could do damage to your system.
    ls could have the /path/of/the/from/directory instead of using the cd command.  The grep command could be replaced with egrep that allows using alternate matching strings:
    ls /path/of/the/from/directory | egrep -v "abc.txt|def.jpg|xyz.mp3|etc..." | while read file
    do
        mv "$file" "/path/to/the/destination/directory/"  # notice the trailing slash for safety
    done
    Good luck.  I hope you do not destroy your system

  • Unable to update software or upload pics from SD card-how do I remove files from startup disk? Please help!

    Unable to update software or upload pics from SD card-how do I remove files from startup disk? Please help!

    Hello Smile_333
    The article below will assist with finding things and help increase the hard drive space for your computer. The best way is to have an external hard drive to copy things to if you do not want to delete and loose things.
    OS X Mountain Lion: Increase disk space
    http://support.apple.com/kb/PH10677
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • How to set all file permissions to default?

    So a few background notes are in order. I came across an article on the NSA's website titled Hardening Tips for Mac OS x 10.6 "Snow Leopard", needless to say I have come to believe I have made this irreversible. The NSA suggested to do some fancy command line coding to disable this, modify that, and change permissions to this. After hours spent on "hardening" my system, I have little hair left to pull in frustration. Is there any way to restore all file permissions back to default? I have used the Repair Disk Permissions, but that has done very little. To give the scope of what permissions have been skewed, I have observed several things:
    The desktop wallpapers, on all Desktops (as I'm in Lion 10.7.3), start from the same picture every time. I have the wallpapers changing, randomly, every 5 minutes.
    Safari doesn't keep the home page. No matter how often I try to change the homepage, I restart Safari, and I'm right back to the original homepage.
    Firefox doesn't retain the fact that I want it to be the default Web Browser. In fact, it keeps "forgetting" that I've used it before, and thus brings me to their awesome start page whenever someone first uses Firefox.
    Spotlight gets "stuck" i.e. almost every time I start my machine, it indexes. Even after I let it finish indexing, the next time I start my computer, it starts again.
    I have to input the administrator password after almost every activity, such as copying to the desktop, moving an application not bought from the Mac App Store into the /Applications folder, deleting a file from anywhere inside my home folder, etc.
    Some preference panes that need access to certain folders, such as Hazel's access to my desktop, are denied that access without ever prompting me for a password (though even if it did, it would get rather annoying after every startup)
    My firewall (in System Preferences>Security & Privacy>Firewall) doesn't "remember" that I do indeed want Dropbox to accept incoming connections. I have to input my admin password at each startup after clicking "allow"
    Opera pretty much doesn't function. Its bookmarking capability, home page, saved tabs, any thing that requires the saving of any type of preference to the computer results in a dialog pop up informing me that Opera failed to save what it needed, and prompts me to "Try again" or "Cancel" (hint: the "Try again" button doesn't work)
    There are more symptoms of an ever growing problem.
    I have backed up my machine from Time Machine, but I think it retains these file permissions, unless I'm wrong.
    Summary:
    How can I fully restore EVERY file permission back to default? Repair Disk Permissions doesn't work
    Is there a way that I can re-install Mac OS X, restore through Time Machine, and achieve the default file permissions, essentially losing all file permissions?

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Launch the Terminal application by entering the first few letters of its name into a Spotlight search. Drag or copy – do not type – the following line into the window, then press return:
    chmod -R -N ~
    If you get an error message about permissions, enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • How to delete all files on old mac?

    Just got a new Mac Dual Core Intel Xeon for my main work computer. Transferred files from old G5 Tower to this new computer. NOW, I need to erase all files on the old G5 so new user can start from scratch (reinstall software, delete all of my old files, etc.)
    What is the best way to do this so that all is erased properly and no settings carry over from my user account?
    THANKS in advance!

    This is how you can erase the HD inside your iMac
    -Insert the installation disc 1 and sthut down your Mac
    -Start your Mac again while holding down the C key
    -Now your Mac should boot from the CD, this can take some time.
    -After a while you will see a installation screen where you can chose a language.
    -Chose English and continue.
    -Then click some time's next and agree with the "Software Agreement".
    -Open Disk Utility. Top menu bar --> Utilities --> Open Disk Utility.
    -Select your hard disk in the list of disks and volumes on the left side
    -Go to the erase tab on the right side
    -Select "Mac OS Extended (Journaled)"
    -Type "Macintosh HD"
    -Click to the options button
    -Select the option "Zero Out Data"
    -Press OK
    -Press the erase button
    -Wait until Disk Utility is ready and close it
    Now you can extit the installer or continue to install a clean OSX.
    Hopefully this is helpfull or solved your problem. Consider rewarding some points!
    Please see the "helpfull" and "solved" button's on top off this message! Apple: Why reward points?

  • Reading All Files inside folder codeBase, Applet!

    I have an applet, placed in a Jar file.. everything is ok,,
    I have a resource folder outside the Jar, which has some files.
    how can I read what is inside the resource folder, which is located outisde the Jar, without having their addresses before hand!!
    in short, I would like the applet to open the resource folder, get an array of all files in the folder, and then reads them.
    I tried encapsulating the getCodeBase().toURI() with a File Object.
    But when I call the file.list() it throws an AccessControlException
    thank you.

    Here is a simple example of using ftp to obtain file list using Jakarta common net package.
    // ftp - related imports
    import org.apache.commons.net.ftp.FTPClient;
    import org.apache.commons.net.ftp.FTPReply;
    // main method
              FTPClient ftpClient = null;
              try {
                   ftpClient = new FTPClient();
                   ftpClient.connect("REMOTE_HOST", "remote port, use 21 in common case");
                   System.out.print(ftpClient.getReplyString());
                   int reply = ftpClient.getReplyCode();
                   if(!FTPReply.isPositiveCompletion(reply)) {
              ftpClient.disconnect();
              System.err.println("FTP server refused connection.");
              System.exit(1);
                   boolean isLoggedIn = ftpClient.login("your login", "your pass");
                   ftpClient.changeWorkingDirectory("/your remote dir/");
                   String[] fNames = ftpClient.listNames();
                   for (int i = 0; i < fNames.length; i++) {
                        System.out.println(fNames);
                   ftpClient.logout();
              } catch (IOException e) {
                   e.printStackTrace();
              } finally {
                   if(ftpClient.isConnected()) {
                        try {
                             ftpClient.disconnect();
                        } catch(IOException ioe) {
                             ioe.printStackTrace();
    System.exit(0);

  • How to play MOV files inside Windows Media Center Edition

    I've installed QT Pro, but am not able to play MOV files inside Windows Media Center Edition (MCE). Under "My Videos" from the MCE main interface, I can see the files, but once selected, error message indicates unknown/unplayable file type.
    How do I get my MOV files to play inside Windows MCE??
    Marc

    Quote from: cosmosk on 05-April-05, 22:29:47
    I don't use MSI's MC application so I can't directly answer your question.
    However both Win DVD 6 and PowerDVD6 play them just fine by launching the ts.ifo file.
    Yes, I know that, but that means that I should use at least two applications. I need only one front end to launch all my media files, inluding ripped DVD files, not as separate VOBs but as whole movies decribed in IFO files.
    Kiero

Maybe you are looking for

  • I install a new hard drive now what??

    i took my laptop to the apple store and it turned out the hard drive shot so i purchased on myself and installed it myself using the website ifixit. everything when well but now what do i do next? i tried to install the software but nothing happen it

  • Windows 7 Product Key Blocked - Not Genuine notice

    My T420 is 3 years old and suddenly yesterday I got the notices and black screen saying "This copy of Windows is not genuine." And nag screens about it roughly every half hour (and annoyingly at boot-up). I tried several fixes online, including re-en

  • Linking a JS object to ScriptUI listbox item

    I am writing a script that that takes elements from a document and for each element makes a custom object with its own properties and methods. This list of elements is then spat out into a ScriptsUI listbox. How do I link each listbox item to its ass

  • Opening file in PDF

    Does anyone know how to open a PDF file separate from the browser. I need the file to open in adobe, brand new window, not in the browser. I have this code which opens it in the browser, I just need it to open separate from the browser in adobe. _roo

  • Collect calls

    Can you accept collect call from jail to your at&t go phones