listing open files 
Author Message
 listing open files

Does anyone know of a way to list open files for a given filesystem
in either Perl or C, for AIX? I might resort to lsof, but it would be
better for me to do it within the code if possible. Thanks,

--

--
"Simplify, simplify." Thoreau



Sat, 10 Jan 2004 06:33:20 GMT  
 listing open files

Quote:
>Does anyone know of a way to list open files for a given filesystem
>in either Perl or C, for AIX? I might resort to lsof, but it would be
>better for me to do it within the code if possible. Thanks,

You can't do this with C (I don't know about Perl), but the POSIX API
(which is implemented as a set of functions callable from C) might be
useful.  comp.unix.programmer would be the place to ask about that.
(Crossposted and followups set.)

dave

--

Absolutely. My only point was that, if you're gonna clear the screen anyway, at
least you could have the decency to put it back like you found it. Oh yeah, and
do it in some other newsgroup too.  :-)     --Richard Heathfield in comp.lang.c



Sat, 10 Jan 2004 07:02:41 GMT  
 listing open files
[f-u set]


Quote:
>Does anyone know of a way to list open files for a given filesystem
>in either Perl or C, for AIX? I might resort to lsof, but it would be
>better for me to do it within the code if possible. Thanks,

you can probably snitch the lsof code into your own.

--
okay, have a sig then



Sat, 10 Jan 2004 08:39:47 GMT  
 listing open files

Quote:

> Does anyone know of a way to list open files for a given filesystem
> in either Perl or C, for AIX? I might resort to lsof, but it would be
> better for me to do it within the code if possible. Thanks,

Open (and close) all files through your own interception routines,
such as:

   FILE *ctgfopen(const char *fname, const char *fmode)
   {
       FILE *f;
       extern int countofilesopen;

       f = fopen(fname, fmode);
       if (f) coutofilesopen++;
       return f;
   }

and increment and decrement a global variable "int
countofilesopen" (after suitable checks for success/failure).

--

   (Remove "XXXX" from reply address. my-deja works unmodified)



Sat, 10 Jan 2004 10:30:49 GMT  
 listing open files
[In CLC]

Quote:
> Does anyone know of a way to list open files for a given filesystem
> in either Perl or C, for AIX? I might resort to lsof, but it would be
> better for me to do it within the code if possible. Thanks,

You could write a wrapper around fopen and fclose, keeping track of
which files have been opened.

Bill, muttering something about an AIX news group.



Sat, 10 Jan 2004 15:57:20 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. list open files

2. Listing open files

3. List open files on shares for remote machine - WMI?

4. Open File - file types list

5. HELP: list of current open files

6. can't open file: to many files open

7. Difference between MRU File Open and Regular File Open

8. Disabling editing of list box items in the file open dialog box

9. Customising list box behaviour in common file open dialog

10. Customize standard file open dialog list view control

11. Notifications from the list view control in File Open dialog

12. HOW TO Filter Files Without File Extention in Open File Dialog Box

 

 
Powered by phpBB® Forum Software