Friday, July 13, 2007

Re: [BLUG] Unix conventions for controlling file access

On Fri, 2007-07-13 at 15:13 +0000, Mark Krenz wrote:
> I'm curious to get opinions on this. I'm working with some support
> technicians for a software company that shall remain nameless for now.
>
> Anyways, a problem came up where temporary files are being written to
> /tmp by a program and then showing up in the output of lsof as
> (deleted). When talking with the support people about this, they said
> that their method of controlling access to these files is to create
> them, then unlink the file while the program is still running. This
> makes the entry disappear from the directory listing. The program
> should still be able to access the file when the filehandle is open, but
> for the most part other programs cannot access it.
>
> What do you think about this?
>

Its not unheard of, though it is a bit annoying if you're trying to
figure out who is sucking up all the disk. The advantage to do it this
way is there is no other way to easily open the file (There's an ioctl()
call using I_OPEN which might do it) and it is automatically dallocated
when the application shuts down (regardless if its a nice shutdown or
not).

Brian

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

No comments: