Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: File descriptors open info Message-ID: <15346@smoke.brl.mil> Date: 27 Feb 91 21:21:40 GMT References: <1991Feb26.213145.26540@batcomputer.tn.cornell.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 11 In article <1991Feb26.213145.26540@batcomputer.tn.cornell.edu> hurf@theory.tn.cornell.edu (Hurf Sheldon) writes: > is there a Unix system call (or some other method) for > finding out how many file descriptors a process has > open? This is another one of the "why would you possibly care?" category of questions. There is no direct support for this, but something of possible use would be to see what value dup(0) returns (then close() the duplicate FD). You will get the lowest available FD number, which may be sufficient. By elaborating on this idea you could also count the FDs initially in use, but why would you want to?