After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 522532 - POSIX semantics when creating files
POSIX semantics when creating files
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: fuse
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 575150 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-03-14 23:58 UTC by Christian Kellner
Modified: 2018-09-21 16:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Kellner 2008-03-14 23:58:44 UTC
Issue raised by Yann Rouillard. I quote him from the mail he sent me:

The try_create_tested_existence doesn't really create the file on the 
server. The file will be created later when the input stream is closed. 
It seems to cause an ordering problem with a program like touch.
touch creates the file and then test is existence, but practically the 
file creation is done by gvfs after the test existence, so touch thinks 
the creation failed.
Comment 1 Christian Kellner 2008-03-15 00:00:16 UTC
Some more of the mail:
	And here is the apache log:
> 
> 127.0.0.1 - - [29/Feb/2008:18:49:41 +0100] "PROPFIND /test HTTP/1.1" 404 
> 282 "-" "gvfs/0.1.9"  -> touch test if the file exists
> 127.0.0.1 - - [29/Feb/2008:18:49:41 +0100] "HEAD /test HTTP/1.1" 404 - 
> "-" "gvfs/0.1.9"  -> try_create test the file existence
> 127.0.0.1 - - [29/Feb/2008:18:49:41 +0100] "PROPFIND /test HTTP/1.1" 404 
> 282 "-" "gvfs/0.1.9" -> touch test if the file has been created (!)
> 127.0.0.1 - - [29/Feb/2008:18:49:41 +0100] "PUT /test HTTP/1.1" 201 259 
> "-" "gvfs/0.1.9" -> the file is created by gvfs
> 
> 	The attached patch create a zero-length file in the 
> try_create_tested_existence to ensure the file is immediately created on 
> the server.
Comment 2 Alexander Larsson 2009-03-10 15:35:13 UTC
I don't think its right to handle this in the http backend.
i.e. i don't think we can guarantee this behaviour with all backends, and would like to avoid ugly hacks that do weird operations just to expose this backends.
For instance, g_file_replace() regularly writes to another file and doesn't replace the final one until close.

However, we might want to make the fuse backend do some ugly workarounds to make apps expecting posix semantics work better.
Comment 3 Christian Kellner 2009-05-27 10:16:27 UTC
*** Bug 575150 has been marked as a duplicate of this bug. ***
Comment 4 Christian Kellner 2009-10-30 12:44:06 UTC
Alex is right, we don't guarantee POSIX semantics for g_file_create etc. pp. (maybe we should note that in the docs?). 

Moving to fuse component.
Comment 5 GNOME Infrastructure Team 2018-09-21 16:19:53 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/43.