[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: opening twice with O_RDWR

From: Paul Pluzhnikov
Subject: Re: opening twice with O_RDWR
Date: Sun, 31 Dec 2006 11:48:07 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Mike - EMAIL IGNORED <> writes:

> Since in my case, a preexisting file does not mean a failure, this
> will not serve unless I use a second "locking file".  I quick test
> has verified this. If, in the above, the word "exists" were changed
> to "opened", my purpose would be served.

What exactly *is* your purpose?

If it is "fail second open of the same file", then just keep track
of already opened files in your program.

>From the OS stand point it is perfectly acceptable and valid to
have the same file opened multiple times, and it is unreasonable
to expect that it will keep track of which files you've already
opened for you ...

In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]