Where to find the number of files in a folder (in Finder)?
I just upgraded from Snow Leopard.
In the past I could look at the bottom of the finder window and see how many files where in a particular folder. And how much megawattage they respresented in total.
Is there some kind of preference I can set in Mountain Lion to be able to see the 'number' of files in a given folder?
All ears,
Ben
Thank you Kurt,
You're an ace.
Much appreciated.
Ben
Similar Messages
-
How to find the number of files in an oracle directory through a storedproc
hi
i have an oracle directory or a directory in an ftp server
is there any way.......through which..
i can know the number of files in the directory ...?
and whats the metadatacolumn that will indicate the name of the file?
and is it possible to loop through each of the entries within oracle
regards
rajops$tkyte@8i> GRANT JAVAUSERPRIV to ops$tkyte
2 /
Grant succeeded.
That grant must be given to the owner of the procedure.. Allows them to read
directories.
ops$tkyte@8i> create global temporary table DIR_LIST
2 ( filename varchar2(255) )
3 on commit delete rows
4 /
Table created.
ops$tkyte@8i> create or replace
2 and compile java source named "DirList"
3 as
4 import java.io.*;
5 import java.sql.*;
6
7 public class DirList
8 {
9 public static void getList(String directory)
10 throws SQLException
11 {
12 File path = new File( directory );
13 String[] list = path.list();
14 String element;
15
16 for(int i = 0; i < list.length; i++)
17 {
18 element = list;
19 #sql { INSERT INTO DIR_LIST (FILENAME)
20 VALUES (:element) };
21 }
22 }
23
24 }
25 /
Java created.
ops$tkyte@8i>
ops$tkyte@8i> create or replace
2 procedure get_dir_list( p_directory in varchar2 )
3 as language java
4 name 'DirList.getList( java.lang.String )';
5 /
Procedure created.
ops$tkyte@8i>
ops$tkyte@8i> exec get_dir_list( '/tmp' );
PL/SQL procedure successfully completed.
ops$tkyte@8i> select * from dir_list where rownum < 5;
FILENAME
data.dat
.rpc_door
.pcmcia
ps_data
http://asktom.oracle.com/pls/asktom/f?p=100:11:4403621974400865::::P11_QUESTION_ID:439619916584
Edited by: Salim Chelabi on 2009-04-21 10:37 -
Programatically count the number of files in a folder
Hi Folks
I need to programatically count the number of files in a given folder and return the value to a Program Unit to be included in further processing.
Can anyone point me in the right direction. I have looked at UTL_FILE but this does not offer what I want.
Does anyone know of an obscure package in Oracle that I could use?
I'm using 9i in a W2K environment.
Many thanks
Simon GaddHi,
following a java based solution i found somewhere on Tom Kyte's AskTom forum.
GRANT JAVAUSERPRIV to TESTUSER;
dbms_java.grant_permission( 'TESTUSER', 'SYS:java.io.FilePermission', 'c:\', 'read' );
create global temporary table DIR_LIST
( filename varchar2(255) )
on commit delete rows
create or replace and compile java source named "DirList"
as
import java.io.*;
import java.sql.*;
public class DirList
public static void getList(String directory)
throws SQLException
File path = new File( directory );
String[] list = path.list();
String element;
for(int i = 0; i < list.length; i++)
element = list;
#sql { INSERT INTO DIR_LIST (FILENAME)
VALUES (:element) };
create or replace procedure get_dir_list( p_directory in varchar2 )
as language java
name 'DirList.getList( java.lang.String )';
exec get_dir_list( 'c:\temp' );
select count(*) from dir_list; -
How do I find the number of file descriptors in use by the system?
Hey folks,
I am trying to figure out how many file descriptors my Leopard system has in use. On FreeBSD, this is exposed via sysctl at the OID kern.open_files (or something close to that, can't recall exactly what the name is). I do see that OS X has kern.maxfiles, which gives the maximum number of file descriptors the system can have open, but I don't see a sysctl that tells me how many of the 12288 descriptors the kernel thinks are in use.
There's lsof, but is that really the only way? And, I'm not even sure if I can just equate the number of lines from lsof to the number of in use descriptors. I don't think it's that easy (perhaps it is and I'm just over complicating things).
So, anyone know where this information is?
Thanks for your time.glsmith wrote:
There's lsof, but is that really the only way? And, I'm not even sure if I can just equate the number of lines from lsof to the number of in use descriptors.
Can't think of anything other than lsof right now. However:
Only root can list all open files, all other users see only their own
There is significant duplication, and
All types of file descriptor are listed, which you may not want, so you need to consider filtering.
As an example, the following will count all regular files opened by all users:
sudo lsof | awk '/REG/ { print $NF }' | sort -u | wc -lIf you run it without the sudo, you get just your own open files. -
Finding the number of files in a directory
hi,
im trying to return the count of all the files that are available in a specific directory. does anyone know how or what method would spport this?
Im new to Java and swing please help!
ThanksHi,
all you need is provided by the File class. With this class you can work with "physical" files.
Try this:
String path = "your directory";
File file = new File(path);
String[] fileArray;
try{
fileArray = file.list();
//you need fileArray.length
System.out.println("Number of files found in "+path+ fileArray.length);
}catch(SecurityException se){
//handle exception
} -
Newbie: How to manage the number of files in a folder
I have a backup application that runs each day and creates a file in a folder.
I have an iCal scipt which automates this backup to run at a specific time but I would like to modify it so that it deletes the oldest file in the folder. I cannot figure out the best way to do this. Does anyone have any suggestions?This rather long script finds the oldest file in the complete nested range of a chosen outer folder and deletes it.
property filePathList : {}
property fileDateList : {}
getEveryFileName((choose folder) as alias)
Sort_items(fileDateList, filePathList)
set oldest to item 1 of filePathList
tell application "Finder" to delete oldest
to getEveryFileName(theFolder)
tell application "Finder"
my getNamesDates(get files of theFolder)
set FolderList to folders of theFolder
repeat with everyFolder in FolderList
my getEveryFileName(everyFolder)
end repeat
end tell
end getEveryFileName
to getNamesDates(FileList)
repeat with everyFile in FileList
try
tell application "Finder"
set end of fileDateList to modification date of everyFile
set end of filePathList to everyFile as alias
end tell
on error anError
display dialog anError
end try
end repeat
end getNamesDates
to Sort_items(sortList, SecondList)
-- sorts by the first list (dates), while keeping the second list in the same order.
tell (count sortList) to repeat with i from (it - 1) to 1 by -1
set s to sortList's item i
set r to SecondList's item i
repeat with i from (i + 1) to it
tell sortList's item i to if s > it then
set sortList's item (i - 1) to it
set SecondList's item (i - 1) to SecondList's item i
else
set sortList's item (i - 1) to s
set SecondList's item (i - 1) to r
exit repeat
end if
end repeat
if it is i and s > sortList's end then
set sortList's item it to s
set SecondList's item it to r
end if
end repeat
end Sort_items
dual-core G5/2.3 Mac OS X (10.4.6) dual screens -
Displaying the number of files in a folder with Mountain Lion?
I recently purchased a new iMac with Mountain Lion and I pretty much hate it. I have been a fan of just about EVERY update, so I am not resistant to change. I just think this is an inferior product. It is slow, clunky, and the update alerts remind me of everything that I hated about PCs. Meh.
Anyway, one of the main problems I have with it is that in previous versions, when I opened a folder, there was a little bit of information at the bottom of the folder that told me how many files were in that folder. As a photographer, I use this information ALL THE TIME. I realize I can click on the folder and "get info" to see how many files are in it...but this is extremely inefficient (especially considering how slow the brand new system is -- in spite of the 3.4 Hz processor and 16GB of RAM).
I can't seem to find anything in the preferences that allows me to change this. If there is a way, I would greatly appreciate it if someone would tell me how! Thank you!Active Memory: 1.88 GB
Free Memory: 91.6 MB
Wired Memory: 1.33 GB
Used Memory: 15.90 GB
Inactive Memory: 12.69 GB
Total VM: 232.58 GB
Number of processes: 92
PID Process Name User CPU Real Mem Virtual Mem
0 kernel_task root 1.6 893.4 MB 10.17 GB
1 launchd root 0.0 2.3 MB 2.39 GB
11 UserEventAgent root 0.0 4.6 MB 2.41 GB
12 kextd root 0.0 6.7 MB 2.39 GB
14 notifyd root 0.0 1.8 MB 2.40 GB
15 securityd root 0.0 10.2 MB 2.41 GB
16 diskarbitrationd root 0.0 2.3 MB 2.39 GB
17 powerd root 0.0 2.4 MB 2.41 GB
18 configd root 0.0 4.9 MB 2.39 GB
19 syslogd root 0.0 1.5 MB 2.40 GB
20 cfprefsd root 0.0 1.8 MB 2.39 GB
21 distnoted root 0.0 2.3 MB 2.41 GB
22 opendirectoryd root 0.0 11.8 MB 2.43 GB
30 warmd nobody 0.0 6.1 MB 2.39 GB
31 usbmuxd _usbmuxd 0.0 2.5 MB 2.40 GB
34 stackshot root 0.0 1.4 MB 2.39 GB
37 revisiond root 0.0 3.0 MB 2.41 GB
38 ptmd root 0.0 1.7 MB 2.38 GB
42 mds root 0.0 127.6 MB 2.93 GB
43 mDNSResponder _mdnsrespo 0.0 3.9 MB 2.40 GB
46 loginwindow karibedfor 0.0 22.0 MB 2.49 GB
47 locationd _locationd 0.0 7.9 MB 2.41 GB
48 KernelEventAgent root 0.0 1.1 MB 2.37 GB
50 hidd root 0.6 3.2 MB 2.39 GB
51 fseventsd root 0.0 15.5 MB 2.42 GB
53 dynamic_pager root 0.0 808 KB 2.32 GB
55 dpd root 0.0 1.9 MB 2.38 GB
56 appleeventsd _eppc 0.0 3.2 MB 2.41 GB
59 blued root 0.0 4.6 MB 2.41 GB
61 autofsd root 0.0 2.1 MB 2.39 GB
62 apsd root 0.0 9.6 MB 2.41 GB
63 coreservicesd root 0.0 24.8 MB 2.43 GB
66 WindowServer _windowser 2.7 52.1 MB 2.97 GB
74 netbiosd _netbios 0.0 3.3 MB 2.40 GB
75 CVMServer root 0.0 1.9 MB 2.41 GB
91 networkd _networkd 0.0 1.4 MB 2.39 GB
100 aosnotifyd root 0.0 8.5 MB 2.41 GB
113 logind root 0.0 2.0 MB 2.39 GB
114 coreaudiod _coreaudio 2.2 9.3 MB 2.40 GB
120 launchd karibedfor 0.0 1.6 MB 2.39 GB
123 UserEventAgent karibedfor 0.0 10.1 MB 2.41 GB
124 distnoted karibedfor 0.0 3.6 MB 2.41 GB
126 cfprefsd karibedfor 0.0 2.3 MB 2.39 GB
132 pboard karibedfor 0.0 996 KB 2.32 GB
137 usernoted karibedfor 0.0 4.4 MB 2.41 GB
141 talagent karibedfor 0.0 7.9 MB 2.43 GB
142 Dock karibedfor 0.0 31.0 MB 2.47 GB
143 SystemUIServer karibedfor 0.0 23.3 MB 2.50 GB
144 Finder karibedfor 0.0 127.3 MB 2.66 GB
154 filecoordinationd root 0.0 12.5 MB 2.39 GB
159 Notification Center karibedfor 0.0 15.3 MB 2.46 GB
162 imagent karibedfor 0.0 6.6 MB 2.41 GB
169 AirPort Base Station Agen karibedfor 0.0 2.0 MB 2.38 GB
172 NetworkBrowserAgent karibedfor 0.0 7.7 MB 2.41 GB
178 fontd karibedfor 0.0 5.8 MB 2.44 GB
181 Photo Stream karibedfor 0.0 17.0 MB 2.44 GB
186 com.apple.dock.extra karibedfor 0.0 18.1 MB 2.44 GB
187 lsboxd karibedfor 0.0 4.3 MB 2.41 GB
189 launchd _spotlight 0.0 1.0 MB 2.39 GB
192 distnoted _spotlight 0.0 1.9 MB 2.41 GB
216 AppleSpell.service karibedfor 0.0 17.0 MB 2.44 GB
243 ntpd root 0.0 1.3 MB 2.32 GB
525 syspolicyd root 0.0 7.5 MB 2.39 GB
569 Photo Mechanic karibedfor 0.5 535.1 MB 1.33 GB
1047 storeagent karibedfor 0.0 12.2 MB 2.42 GB
1061 maspushagent karibedfor 0.0 5.5 MB 2.40 GB
2094 SleepServicesD root 0.0 1.6 MB 2.34 GB
2118 cfprefsd _spotlight 0.0 1.4 MB 2.39 GB
2139 taskgated root 0.0 3.8 MB 2.40 GB
2156 cookied karibedfor 0.0 1.6 MB 2.39 GB
2176 Safari karibedfor 0.0 63.7 MB 3.57 GB
2181 xpcd karibedfor 0.0 6.6 MB 2.41 GB
2185 com.apple.iCloudHelper karibedfor 0.0 6.2 MB 2.41 GB
2283 pbs karibedfor 0.0 6.9 MB 2.40 GB
2333 ocspd root 0.0 2.8 MB 2.37 GB
2347 accountsd karibedfor 0.0 5.2 MB 2.37 GB
2355 xpcd _spotlight 0.0 4.8 MB 2.36 GB
2370 mdworker karibedfor 0.0 10.2 MB 2.38 GB
2373 CalendarAgent karibedfor 0.0 14.8 MB 2.41 GB
2374 tccd karibedfor 0.0 2.0 MB 2.36 GB
2376 Safari Web Content karibedfor 0.3 207.2 MB 3.76 GB
2383 syncdefaultsd karibedfor 0.0 12.4 MB 2.41 GB
2386 mdworker karibedfor 0.0 8.3 MB 2.37 GB
2387 Flash Player (Safari Inte karibedfor 0.9 48.4 MB 3.56 GB
2388 helpd karibedfor 0.0 2.2 MB 2.37 GB
2389 Activity Monitor karibedfor 4.1 23.3 MB 2.49 GB
2391 activitymonitord root 1.0 1.4 MB 2.33 GB
2392 CVMCompiler karibedfor 0.0 20.3 MB 2.38 GB
2393 mdworker _spotlight 0.0 5.7 MB 2.36 GB
2394 mdworker _spotlight 0.0 10.3 MB 2.40 GB
2395 mdworker karibedfor 0.0 9.4 MB 2.40 GB
2396 sandboxd root 0.0 6.7 MB 2.41 GB -
Where do I find the "number of apps to update" button on the new iTunes?
I can't find the "number of apps to update" option in the new iTunes. Where has it gone?
Hi Janice
If you are talking about the Hard Drive, click on the Hard Disk on your Desktop to highlight it and then from the Finder menu > File select *Get Info*. You can also press Command + i to get the same dialogue box to open.
There you will see, the Capacity of the Hard drive, how much is used and how much free space remains.
If you are talking about the RAM, that shows in the first opening window of System Profiler. -
How to find the number of data items in a file written with ArryToFile function?
I have written an array of number in 2 column groups to a file using the LabWindows/CVI function ArrayToFile...Now if I want to read the file with FileToArray Function then how do I know the number of items in the file. during the write time I know how many array items to write. but suppose I want the file to read at some later time then How to find the number of items in the file,So that I can read the exact number and present it. Thanks to all
If you are young work to Learn, not to earn.
Solved!
Go to Solution.What about:
OpenFile ( your file );
cnt = 0;
while ((br = ReadLine ( ... )) != -2) {
if (br == -1) {
// I/O error: handle it!
break;
cnt++;
CloseFile ( ... );
There are some ways to improve performance of this code, but if you are not reading thousands of lines it's quite fast.
After this part you can dimension the array to pass to FileToArray... unless you want to read it yourself since you already have it open!
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
How do you find the number of lines in a file?
I need to count how many lines there are in a file, I am using a BufferedReader to read in the data, but how can I find the number of lines?
ThanksThat depends. How do you define a line? Is it a specific number of
characters, a String that's terminated by a newline character or some
combination thereof? -
Where can I find the latest cab file?
Where can I find the latest cab file? for example:
CODEBASE=http://java.sun.com/update/1.5.0/jinstall-1_5_0_05-windows-i586.cab
CLASSID=clsid:5852F5ED-8BF4-11D4-A245-0080C6F74284 It is not available on this page: http://java.com/en/download/manual.jsp
I am deploying using web start. So I need it.
thanks,
AnilDownload Java EE SDK, install it and finally in the lib directory you'll find the javaee.jar. It contains the whole javax package you need.
-
Where can I find the a downloaded file by Software update?
Where can I find the a downloaded file by Software update?
For example is there any way to find a package which is downloaded but is not installed(because the installation failed) (in this case 10.5.5) and I don't want to download it once again neither manually nor with software update.sina_golesorkhi wrote:
Where can I find the a downloaded file by Software update?
In ~/Downloads
For example is there any way to find a package which is downloaded but is not installed(because the installation failed) (in this case 10.5.5)
Failed installs usually remove the package, just as a proper install removes the package
All that remains for a proper installation is a Receipt in on of the following directories:
~/Library/Receipts (for user-specific installs)
Macintosh HD/Library/Receipts
for system-wide installations, including OS-X updates.
and I don't want to download it once again neither manually nor with software update.
If it did not install, there is no Receipt and the downloaded file is not on your system
If you don't want to see it again in automatic updates, put it on ignore. -
Hi
My iPad is filling up my PowerBook hard disk. Where can I find the sync Photo file to delete it ?
Copying over photos via iTunes/iPhoto - there is a back-up file created (I can not turn it off) and it's now filling my PB-Pro.
So I need to find it and trash it and start over.
- Where is it located ?
- What is it's name ?
Yours Bengt WThank You
I found my iPhoto library
ctrl-clicked on it and opened package/content
here I found the iPod photo cashe folder
copyed this to a safe hard disk
then deleting it's content
and my memory/free space on boot drive is back
So I hope all's well.
Yours Bengt W -
HT201210 where can i find the back up file for my iphone?
its not backing up. its said i have to delete the corrupted back up file first, but where can i find the back up file? thanks
You can look this up using the Support search bar at the top of this page.
iTunes: About iOS backups -
I am having finder issues. Mostly on the main hard drive. It takes ages to find things and I get the spinning wheel every time I open a folder.
So I moved all of my files to a external drive. When I had finished transfering I hit get info on the files on the external drive and on the same folder on the main drive. To ensure that it has copied over all the files. Because it was acting up and not copying all the files.
Get Info refuses to show the number of files within the folders on the main hard drive. It hasppily tells me everything on any of the external drives.
I have reset, the imac. I have re indexed 3 times. I have deleted the finder plist files. I have reset finder using terminal commands. I have moved nearly everything off the main hard drive. But nothing is working.
Can anyone offer any suggestions as to what could be causing my finder and get info issues.
Any help wpuld be appreciated.
Running Mountain Lion on a late 2009 ImacSome of your user files (not system files) have incorrect permissions or are locked. This procedure will unlock those files and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
Back up all data.
Step 1
If you have more than one user, and the one in question is not an administrator, then go to Step 2.
Enter the following command in the Terminal window in the same way as before (triple-click, copy, and paste):
sudo find ~ $TMPDIR.. -exec chflags nouchg,nouappnd,noschg,nosappnd {} + -exec chown $UID {} + -exec chmod +rw {} + -exec chmod -N {} + -type d -exec chmod +x {} + 2>&-
This time you'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
Step 2 (optional)
Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
Start up in Recovery mode. When the OS X Utilities screen appears, select
Utilities ▹ Terminal
from the menu bar. A Terminal window will open. In that window, type this:
res
Press the tab key. The partial command you typed will automatically be completed to this:
resetpassword
Press return. A Reset Password window will open. You’re not going to reset a password.
Select your startup volume ("Macintosh HD," unless you gave it a different name) 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.
Maybe you are looking for
-
Palm Desktop will not update with Data after HotSync
All: Palm Centro Windows Vista Desktop v6.2.2. HotSynch Manager 7.0.2.2. I have a Palm Centro with Windows Vista. Everytime I HotSync, some of the Desktop items (Calendar, Contacts, Etc.) are updated. I uploaded Palm Desktop so it is the latest ve
-
How to remove stroke in illustrator
Hello, I designed a font Helvetica Ultralight with fill 20 % gray . When I save for web to convert it to PNG 24 with transparent background, appears a white stroke that makes the picture look pixelated. Help me please T_T '
-
How to get user name of user who uploaded to the Knowledge Directory?
Greetings, How can I find out who uploaded a document to the Knowledge Directory? My users want to know who uploaded the documents they are viewing in the KD. I hope there is some option other then creating "Related Experts" for each folder. The Coll
-
Adobe creative suite cs3 design premium
Hi there, I've recently bought the new macbook pro (10.9.2) and was wondering if the ADOBE CREATIVE SUITE CS3 DESIGN PREMIUM software would still work on the new laptop? If anybody could help me, it would be most appreciated. Regards, Amy
-
I am a new first time user of adobe to convert pdf. files to word, etc. I must add that I am 75 years old and not a computer literate fellow. I have a fairly large pdf file that I want to convert to word so I can cut & paste, etc ? Any & all help