Re: File conflict in Windows

From: Roland Kuhn <rkuhn_at_e18.physik.tu-muenchen.de>
Date: Mon, 12 Feb 2007 15:55:59 +0100


Hi Valeri!

It is (and was) not my intention to start an OS flamewar, I simply wanted to clarify how things work on Linux.

On 12 Feb 2007, at 15:25, Fine, Valeri wrote:

> Thank you for your information about Linux file system. This must
> be taken in account of course.
>
>> the other process(es) will just see the old contents.
>
> Wow !!!
> I am not sure whether this is what the Tom wanted.
>
> For me this is a little bit confusing
> Normally If I open the file with one and the same name I do want to
> see one and the same data.
> You claim this is not the case under Linux. The result depends of
> some sort of luck.
>

No, no luck involved: once you open()ed a file, your file descriptor refers to that file exactly. This means that if after the open() the file is unlink()ed (dissociated from its name in the directory, eventually deleted once closed by all programs) and re-created, the file which is available under the same name is actually not the same file system object and therefore writes to this new file cannot affect our old file descriptor. This is quite handy for creating temporary files, BTW.

> Anyway, the Windows and Linux file system behave differently and I
> had proposed the approach that may have made the application
> behavior consistent across of the platforms, had I ?
>

Yes, terminating all processes between runs should work universally, but it might not be convenient.

>> It is a shame that Windows cannot cope with deleted open files.
>
> For the record.
> I said Windows File System does provide such feature too. It is not
> provided "by default".

I don't know much about Windows, but what you talked about seemed to be something else, namely that the _same_ file can be open simultaneously by multiple processes. I'm talking about different files which happen to have had the same name at different points in time, which might well not be supported by Windows, I just don't know.

Ciao,

                     Roland

--
TU Muenchen, Physik-Department E18, James-Franck-Str., 85748 Garching
Telefon 089/289-12575; Telefax 089/289-12570
--
CERN office: 892-1-D23 phone: +41 22 7676540 mobile: +41 76 487 4482
--
Any society that would give up a little liberty to gain a little
security will deserve neither and lose both.  - Benjamin Franklin
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GS/CS/M/MU d-(++) s:+ a-> C+++ UL++++ P+++ L+++ E(+) W+ !N K- w--- M 
+ !V Y+
PGP++ t+(++) 5 R+ tv-- b+ DI++ e+++>++++ h---- y+++
------END GEEK CODE BLOCK------



  • application/pkcs7-signature attachment: smime.p7s
Received on Mon Feb 12 2007 - 15:56:23 CET

This archive was generated by hypermail 2.2.0 : Mon Feb 12 2007 - 17:50:01 CET