Aditya wrote:
>
> Hi
> I am using Red Hat linux 9 and gcc 3.4.
[... Removes an open file ...]
[...]
> Now I give the input and debug through the application, I find that
> the fseek(), fwrite(), fflush() calls in the application for writing
> to the file do not throw error even though the file is not existant.
> I cannot understand, where is that data written. If it is wriiten to
> the buffer, then fflush() should have re****ted error. But it also
> succeeds.
[...]
Well, the Standard states:
If the file is open, the behavior of the remove function is
implementation-defined.
Given that you are using Linux, this is probably better suited for on
of the Linux and/or Unix newsgroups.
However, in brief, Linux allows one to remove an open file. In this
case, the file[*] still exists, albeit without a filename, until the
last open instance is closed. At that point, the file[*] ceases to
exist. All of your file I/O functions work just fine, because the
FILE* still points to a valid file[*].
[*] Technically, it is the "i-node" which exists, with zero links.
Ask one of the Linux and/or Unix newsgroups for further details.
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@[EMAIL PROTECTED]
>
--
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
-- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line. Sorry.


|
10 Posts in Topic:
|
Aditya <adityagupta.18 |
2008-04-01 12:16:56 |
|
gordonb.hzgc0@[EMAIL PROT |
2008-04-04 10:34:02 |
|
Kenneth Brody <kenbrod |
2008-04-04 10:34:07 |
|
=?ISO-8859-1?Q?Hans-Bernh |
2008-04-04 10:34:14 |
|
Mark Bessey <mark_bess |
2008-04-04 10:34:19 |
|
Keith Thompson <kst-u@ |
2008-04-04 10:34:21 |
|
Jack Klein <jackklein@ |
2008-04-04 10:34:29 |
|
Val <Valery_Creux@[EMA |
2008-04-04 10:35:23 |
|
Barry Schwarz <schwarz |
2008-04-04 10:35:06 |
|
Ivan Chernetsky <ivan_ |
2008-04-04 10:35:11 |
|