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 144887 - unable to copy file to msdos/FAT fs
unable to copy file to msdos/FAT fs
Status: RESOLVED DUPLICATE of bug 78486
Product: gnome-vfs
Classification: Deprecated
Component: File operations
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2004-06-23 19:30 UTC by Stanislav Brabec
Modified: 2005-02-02 17:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description Stanislav Brabec 2004-06-23 19:30:30 UTC
strace gnomevfs-copy /home/sb/Desktop/photo/pict0803.jpg
/media/camera/dcim/101image/pict0803.jpg
...
open("/media/camera/dcim/101image/.vfs-write.tmp",
O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_LARGEFILE, 0600) = -1 EINVAL (Invalid argument)

Solution: Use better file name, at least on 8+3 filesystems.
Comment 1 Robert 2004-06-24 02:12:18 UTC
I can confirm this e.g.

dd if=/dev/zero of=/tmp/fat bs=1M count=10
mkdosfs -A /tmp/fat
mount -o loop /tmp/fat /mnt/fat

strace gnomevfs-copy /tmp/file /mnt/fat/file
   
...

open("/mnt/fat/.vfs-write.tmp", O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_LARGEFILE,
0600) = -1 EINVAL (Invalid argument)

I traced this back to gnome-vfs-xfer.c line 2030 - 2047

at least with my example the problem seems to be with using a dot file and
not the file length i.e. changing to 'vfs-write.tmp' works, the filename is
just truncated to 8+3.

I tested with gnome-vfs-2.6.1.1
Comment 2 Allison Karlitskaya (desrt) 2004-08-12 19:04:21 UTC
Right after the creation of this file there is the special case:

        /* some methods only allow certain filenames (e.g. .desktop files) */
        if (result == GNOME_VFS_ERROR_INVALID_URI) {
                result = GNOME_VFS_OK;
        }

EINVAL is not a documented return for open, so one can only hope that it's only
ever returned in this specific situation.  It maps through
gnome_vfs_result_from_errno() to GNOME_VFS_ERROR_BAD_PARAMETERS.

If we add GNOME_VFS_ERROR_BAD_PARAMETERS to the above if() the problem should go
away.

Alternatively (probably cleaner) we could add a special case (maybe #ifdef
__linux__) in the do_create function of the file:// method that in the event of
EINVAL, it returns GNOME_VFS_ERROR_INVALID_URI instead of calling
gnome_vfs_result_from_errno();
Comment 3 Christian Kellner 2005-02-02 17:58:19 UTC

*** This bug has been marked as a duplicate of 78486 ***