I did a fresh install of Ubuntu 20.04 today. I got as far as setting up my vim environment which installs plug.vim using curl when I hit a speed bump.
Error creating directory /home/simon/.vim/autoload.
curl: (23) Failed writing received data to disk/application
The relevant lines in the .vimrc are:
" Auto-install plugin manager if it doesnt exist (and PlugInstall)
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
Trying to isolate the problem, it seems like I can't use a path with a dot file in it as an output for curl.
eg. This fails:
➜ ~ curl -fLo ~/.test_dot_folder/test.py --create-dirs example.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file /home/simon/.test_dot_folder/test.py: No
Warning: such file or directory
100 1256 100 1256 0 0 2800 0 --:--:-- --:--:-- --:--:-- 2803
curl: (23) Failure writing output to destination
But this works:
➜ ~ curl -fLo ~/test_dot_folder/test.py --create-dirs example.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1256 100 1256 0 0 2659 0 --:--:-- --:--:-- --:--:-- 2661
➜ ~
The only difference is the . in front of the folder.
Even when I do
mkdir .test_dot_folder
and then run the first curl command, it still fails.
If you're wondering about permissions in the directory:
Here's what happens when I run @waltinator's pathlld script on my home directory.
➜ ~ sudo code/pathlld.sh -v .
drwxr-xr-x 22 simon simon 4096 Aug 7 20:15 .
/dev/nvme0n1p5 on / type ext4 (rw,relatime,errors=remount-ro)
Any suggestions as to what's going wrong?
https://github.com/waltinator/pathlld. Abashscript to answer "Why can't I Read/Write that file?". – waltinator Aug 06 '21 at 18:13.in my home directory which I seem to have all of the relevant permissions for:➜ /home ./simon/code/pathlld.sh simon drwxr-xr-x 22 simon simon 4096 Aug 7 05:49 simon
– Teg Veece Aug 06 '21 at 19:52sudo /path/to/pathlld.sh /path/to/problem. – waltinator Aug 06 '21 at 21:35drwxr-xr-x 22 simon simon 4096 Aug 7 20:15 . /dev/nvme0n1p5 on / type ext4 (rw,relatime,errors=remount-ro)How should I interpret that?
– Teg Veece Aug 07 '21 at 10:16/home/simon/.vim/autoload, not the current directory, you shouldsudo code/pathlld.sh /home/simon/.vim/autoload– waltinator Aug 08 '21 at 00:28- That directory doesn't exist before I run the curl command (
- The error happens even if I specifiy curl to make an output file in the home directory whose filename starts with a
– Teg Veece Aug 08 '21 at 04:25curlis supposed to create it)..(ie is hidden). It runs fine if the file name doesn't contain a hidden directory or filename.