Subject: Re: Addition to force open to open only regular files
To: None <greywolf@starwolf.com>
From: Love <lha@stacken.kth.se>
List: tech-kern
Date: 11/24/2000 09:15:08
[ Not that I'm intrested in getting flamed, just trying to point out that
  this already exists ]

Greywolf <greywolf@starwolf.com> writes:

> reserve() would return a filehandle of sorts 

getfh(2)

> which could then be passed to ropen() to return a descriptor?

fhopen(2)

> One could also have an rstat() call to stat the filehandle and find out
> what you've reserved.

fhstat(2)

> Since the reserve would lock the node, the rstat() would be guaranteed to
> return valid information, and ropen() would be guaranteed to return a
> valid fd into the data, even if an unlink() has transpired.

That is not the case getfh(2), but then why would you want it.

> It seems to me probably a bit extreme, though, to go through these hoops
> to accomplish something that is probably best solved in another way,
> although a reserve() call would be GREAT for things like temp files...

What's wrong with open(...|O_EXCL) ?

Love