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.

Similar Messages

  • Limit on the number of file names retrieved using FM 'RZL_READ_DIR_LOCAL'

    Hi All,
    I am using FM 'RZL_READ_DIR_LOCAL' , to retrieve file names from a specified directory.
    When executed, i am getting 10,000 records(file names) only against lakhs of files present in the directory.
    I would like to know if there is any limitation on the number of file names retrieved using that FM and how to over come it.
    Also please let me know if the FM 'EPS2_GET_DIRECTORY_LISTING' also has any such limitations.
    Thanks in advance,
    Sreeni Vallem

    I did not know about this limitation of number of files returned. You can give a try to the external command way of doing it in your development system.  Well, creating 10001 files in development is a boring job . You can write a sample program as Rob has mentioned in this thread and copy files to a specific directory ABAP: Copy files from one R3 directory to another. This doesn't disturb the existing program written.
    Mean while let's wait for expert's reply.
    Kesav

  • Limiting the number of files being picked up by the sender file adapter

    We are running a file adapter to collect xml files from a legacy system in a shared network location.  The files are picked up, information is sorted and mapped, and then sent to a proxy on our CRM system to store the data.  Very simple and not-complex.
    Our initial data load will consist of somewhere in the neighborhood of 900k records, which is killing CRM.
    A co-worker with a bit more experience was telling me that he believes there is a way to limit the number of files that will be pulled per iteration of the file communication channel.  If this is the case, can someone share with me the parameters that need to be set?
    My apologies if this is a duplicate post - I have tried to look for a good answer in the forums and have come up empty.
    We are running PI 7.1, and I believe it is SP 6. 
    Thanks in advance for the help,
    Ben

    Hi Ben,
    There is no standard way to limit the number of files to be processed by the communication channel.
    On the Sender File CC, there is a parameter " Maximum File Size" which restricts the files bigger than the specific size, but this is just a prevention not a solution.
    If you have a single big size file, then somehow you have to create small sized files out of it.
    Thanks,
    Pooja Pandey

  • How do I find total number of songs in my library in the new iTunes 11?

    Last version of iTunes showed the total number of songs within the library on the bottom of the screen.  Now that's disappeared and I don't know where to find that piece of info.
    Any suggestions?

    Click View>Show Sidebar
    It looks about like the old version.
    Or you can simply click your ipod name at the top of your screen and sync as always.
    The new version is not that different from the old one

  • Is there a limit to the number of Photos one can use in the Screen Saver?

    As the title inquires... I recently help set-up a friend's screen saver to use their entire iPhoto library as content. The library has about 2,800 pictures. When the screen saver engaged, the 'Looking for pictures...' dialogue came up, and 10 minutes later it is still there. I am hoping that it is just indexing these photos, and once complete the screen saver will kick in, and future activations of the screen saver will kick in more quickly.
    If not, what is the limit? And, if you are from Apple and are reading this, why did you not include this information in an easy to access location, so that going through all of this would not be necessary.

    There is no limit as to the amount of pictures the screensaver can use. However the more pictures there is a slightly longer loading time. HOWEVER still, it should not take 10 minutes for 2800 pics. It shouldn't even take a minute.
    It would be a little helpful as to what computer your running and what OS, but here is a good suggestion.
    The first thing you want to do is to make sure you have the most recent updates for the OS and iPhoto. (Use the software updater)
    Next you should repair disk permissions. Go into apps, into utilities, open disk utility, click your hard-drive on the left, and click repair disk permissions. When thats finished (10-30 minutes depending) restart the computer. For reasons that I'm not quite sure, disk permissions fixes many problems and glitches you may encounter.
    Try setting you screensaver again.
    ~Valen

  • 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
    raj

    ops$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

  • 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

  • Finder issues and Get Info refusing to show the number of files on items on the main hard drive.

    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 Imac

    Some 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.

  • [Win VC++ 6.0 ]How to get the number of files count in a folder using VC++ 6.0?

    Hi all,
    Can any one tell how to get the number of files(.EPS) count inside a folder when the folder path is specified in VC++ 6.0?
    Thanks in Advance.
    Regards
    myriaz

    I'm a little confused by the question, but it sounds like you're asking how to count the number of files with a particular extension in a given directory? That's not really an AI SDK question, but it's a fairly easy one to find if you google it. If you're trying to use Illustrator to do it, AI doesn't have a general purpose file API. It has a few functions to do some things that Illustrator needs, but I don't think enumerating directories is one of them.

  • Why does OS X Finder recognize a folder as a file when it counts the number of files?

    When I select a folder in Finder and click cmd+i(or cmd+option+i), it shows the number of files in the folder. However, that number is weird for me, because they count a folder itself as a file. For example, when I have a single file in my Download folder and I clicked cmd+i on Download folder, then the number of files in a inspection window is 2, not 1. It is because that number includes not only the file inside the folder, but also the folder itself. (Check the below image)
    This is not a big problem if there is no hierarchical structure in my folder. But, if I have thousands of files and folders inside, it is really hard to figure out how many files(not folders) are inside. I cannot understand why Mac OS X counts a folder as a file. In fact, a folder is not an actual file, just a container.
    So, is there any philosophy to do like this? Or is there any way to count only the number of actual files?

    Sorry byron1st
    there is no way to count only files in a folder.
    Finder will count everything inside, folders and files.
    Information about a folder will count the same.
    If there are no subsubfolders in one folder, maybe a little trick can help:
    Select list view for the open folder, close all subfolders.
    Type command+# to see the footer of the window, that counts (hopefully) only the closed subfolders (content) in the open folder.
    Remember the amount.
    Hold option and click on one triangle in front of one subfolder. All subfolders will be opened!
    The difference between amount a and amount b is the number of files (and subsubfolders, if unfortunately inside…).

  • The have stolen my laptop, how can I find it? is it possible to use serial number to find it?

    they have stolen my laptop macbook pro i7, still new and got all my research, how can i find it and is it possible to use the serial number to find it? please help

    Unless you have an active MobileMe account with Find My Phone activated for the laptop and the laptop is connected to a WiFi site, then you cannot locate it. File a police report and file with your insurance company.

  • How do I find out what program / file is using 100 GB of space on my Hard drive?  Once I find the problem  how do I delete the specific files to increase GB of space?

    How do I find out what program / file is using 100 GB of space on my Hard drive?  Once I find the problem  how do I delete the specific files to increase GB of space?

    Use OmniDiskSweeper
    Once you find file, it can be deleted from within OmniDiskSweeper
    Allan

  • How to get the number of files currently open?

    hi,
    does any one know how to get the number of files currently open in windows OS?
    e.g. lets say .txt files...
    any comment will be really appreciated.
    thanks

    Assuming that you don't want to actually do this from within Java code (which would obviously require native code), here's a utility that will give you a list of which file handles are opened by which processes (on Windows):
    http://www.sysinternals.com/ntw2k/freeware/handle.shtml
    - K

  • How to increase the number of files picked up by File adaptor

    Dear all,
    Can any one tell me how to increase the number of files picked up by File adapter.
    Pl post ASAP.
    Useful answers will be appreciated accordingly.
    Thanks,
    Srinivas

    Hi Srinivasa,
    there is no parameter for number of files to be picked..............if you have too many source files and you want to get them processed quickly, then you can specify a very small polling interval, then XI will pick your source files quickly..........but it will cause heavy load on the XI system which can lead to blockage of messages in queues........
    Regards,
    Rajeev Gupta

  • How do I find Serial number of programme (not the one on the CD cover)?

    How do I find Serial number of programme (not the one on the CD cover)?

    How is that related to Firefox support?

Maybe you are looking for