wrote:
>
> Hello,
>
> I have a shared drive on SGI, Linux, and Windows.
>
> A second call to fopen doesn't create the file if it has been
> deleted.
I believe this is really platform-specific given your description.
I don't know if it's a Linux issue of a Windows issue.
Is the first FILE* still open? Linux lets you delete files that
are still open, Windows does not. What happens when Windows has
a Linux file open, one can only guess. I doubt the standard says
anything about this, beyond "undefined" or "implementation specific".
[...]
> I talked to my system person and he said something "like" this. That it
>
> is a caching problem. Windows has the file in cache memory. All
> references to it affect the cached file. You can do fopens (NULL not
> returned, and errno not set), reads, and writes, but they do not
> affect the file in question on the shared drive. He went on to say that
>
> I have to use "creat" and change all read/writes appropriately.
If fopen() returns something other than NULL, then errno won't be
set because it didn't fail.
If the first FILE* is still open, I would venture to guess that your
"system person" may be on to something. The file is still open, so
it may be that Windows doesn't bother asking the remote system to
re-open the file, instead opting to duplicate the existing handle.
If the first FILE* was closed before the file was removed, then it
may be a bug in Windows, allowing you to open a file which is no
longer there. (Though one could claim my first scenario is a bug
as well.)
You'll probably have to ask a Windows newsgroup for further details.
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody |
www.hvcomputer.com | |
| kenbrody/at\spamcop.net |
www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <private.php?do=newpm&u=>