Replacing files fail in softlinks to GVFS mounts
DESCRIPTION
When you try to replace a file in a link to a GVFS share, an error appears. Either: "error while copying" "error opening file" "operation not supported",
or when you deleted the file before in order to allow the copy anyway: "error while copying" "error opening file" "no such file or directory"
Expected behavior would be, that the file is being replaced after confirmation.
REPRODUCTION
-
mount an SMB network share with
gio mount smb://server/share/
-
edit the VARS in the script below to match your environment
-
run the script below in a shell as often as you like and notice it works just fine
-
now replace the existing file in the link with Nautilus via Copy & Paste -- you get an the error
-
also the script throws similar errors now -- somehow Nautilus messed with the file system
ENVIRONMENT
I am on Ubuntu 20.04 LTS latest.
The Fuse-mount points to an SMB share (in my case from a Synology NAS).
This error exists since some weeks - before it was fine.
A fix would be higly appreciated, since GVFS mounts are quite cryptic, and you can use it with links only. Currently I can barely work with Nautilus
Thanks a lot for looking into the issue!
TEST SCRIPT
#!/bin/bash
#set -o xtrace
FILE="file"
LINK="link"
USER="1001" # see /run/user/
SERVER="server"
SHARE="share"
[ ! -d "$LINK" ] && ln -s /run/user/$USER/gvfs/smb-share:server=$SERVER,share=$SHARE/ $LINK
[ ! -f "$FILE" ] && touch $FILE
[ ! -f "$LINK/$FILE" ] && cp $FILE $LINK
echo "1st error: replace fails"
cp $FILE $LINK
echo "2nd error: delete fails"
[ -f "$LINK/$FILE" ] && rm $LINK/$FILE
echo "now replace the file in the link with Nautilus - and run the script again"