2

I can see with lsof that a process has an open filehandle for a particular file, but is there a way that I can see what kind of filehandle (ex: r, rw) it is?

kclair
  • 121
  • 2

2 Answers2

5

From the lsof manpage

  FD is followed by one of these characters, describing the mode 
  under which the file is open:

       r for read access;
       w for write access;
       u for read and write access;
       space if mode unknown and no lock
            character follows;
       `-' if mode unknown and lock
            character follows.

So in the line

liferea    3264    dennis    0r   CHR    1,3    0t0     1049 /dev/null

You can see that stdin is open in read only mode

Zoredache
  • 130,897
  • 41
  • 276
  • 420
Dennis Kaarsemaker
  • 19,277
  • 2
  • 44
  • 70
0

nevermind, I see this is part of the normal output of lsof:

FD is followed by one of these characters, describing the mode under which the file is open:

r for read access; w for write access; u for read and write access;

kclair
  • 121
  • 2