Взаимодействовать с файлами, содержащими пробелы, через webdav - PullRequest
0 голосов
/ 17 апреля 2019

Я не могу получить доступ к файлам, которые смонтированы через webdav и содержат пробелы в своих именах.Сервер Webdav - это Zimbra 8.0.9.Система монтирования - Ubuntu 18.04.01.

Как мне правильно экранировать пробелы?

sudo mount -t davfs https://server.com/dav/user1/ /home/user1/mount_point

user1@host:~$ ls -la mount_point/attachments/by-type/text/today/*
total 375
drwxr-xr-x 2 root root    176 Apr 17 20:35  .
drwxr-xr-x 6 root root    216 Apr 17 20:35  ..
-rw-r--r-- 1 root root 191068 Apr 17 14:58 'file with spaces.ics'
-rw-r--r-- 1 root root 191068 Apr 17 14:58 'file with spaces.ics'  <-- really identical file name
-rw-r--r-- 1 root root 191068 Apr 17 14:58 'file with spaces.ics'  <-- really identical file name
-rw-r--r-- 1 root root   1345 Apr 17 14:58 file_without_spaces.ics
-rw-r--r-- 1 root root   1345 Apr 17 14:58 file_without_spaces.ics  <-- really identical file name
-rw-r--r-- 1 root root   1345 Apr 17 14:58 file_without_spaces.ics  <-- really identical file name


user1@host:~$ cat mount_point/attachments/by-type/text/today/file\ with\ spaces.ics
cat: 'mount_point/attachments/by-type/text/today/file with spaces.ics': No such file or directory

user1@host:~$ cat "mount_point/attachments/by-type/text/today/file with spaces.ics"
cat: 'mount_point/attachments/by-type/text/today/file with spaces.ics': No such file or directory

user1@host:~$ cat "mount_point/attachments/by-type/text/today/'file with spaces.ics'"
cat: "mount_point/attachments/by-type/text/today/'file with spaces.ics'": No such file or directory


user1@host:~$ sudo tar -cf files.tar mount_point/attachments/by-type/text/today/
[sudo] password for user1:
tar: mount_point/attachments/by-type/text/today/file with spaces.ics: File removed before we read it
tar: mount_point/attachments/by-type/text/today/file with spaces.ics: File removed before we read it
tar: mount_point/attachments/by-type/text/today: file changed as we read it

Файлы без пробелов не являются проблемой:

user1@host:~$ cat mount_point/attachments/by-type/text/today/file_without_spaces.ics
[... file content ...]
...