[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: determing number of open streams/files
- To: franz!ucbarpa!PRC.Unisys.COM!fritzson
- Subject: Re: determing number of open streams/files
- From: franz!frisky!jkf@ucbarpa.Berkeley.EDU (John Foderaro)
- Date: Tue, 4 Apr 89 13:08:40 EDT
- Cc: franz!ucbvax.Berkeley.EDU!excl-forum
- In-reply-to: Your message of Tue, 04 Apr 89 12:26:42 D. <8904041626.AA01237@caesar>
Here is one way to compute the number of number of file descriptors
currently in use:
(defun numopen ()
(let ((count 0))
(dotimes (i 32)
(cond ((excl::filesys-filestat i) (incf count))))
count))
The constant '32' should be replaced by a number greater than
or equal to one less than the maximum number of open file
descriptors your unix permits.
You could also advise the open and close functions and keep a running
count of files opened (although you may miss some file descriptor
creation due to functions such as run-shell-command).
-- john foderaro
franz inc.