pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/59072: Can't delete vim backup on NetBSD with msdos filesystem



triaxx%netbsd.org@localhost writes:

>    drwxr-xr-x  1 root  wheel   4096 Nov  2  2023 .
>    drwxr-xr-x  1 root  wheel   4096 Nov  1  2023 ..
>    -rwxr-xr-x  1 root  wheel    357 Feb 12 21:35 boot.cfg
>    -rwxr-xr-x  1 root  wheel      0 Feb 12 22:23 bootcf~1.swp
>    -rwxr-xr-x  1 root  wheel      0 Feb 12 22:23 bootcf~1.swx
>    -rwxr-xr-x  1 root  wheel  12288 Feb 12 22:24 bootcf~2.swp

>When I write this file (:w), I get a error message in the status bar of vim:
>    "/mnt/boot/efi/netbsd/boot.cfg" 7L, 357B written
>    E207: Can't delete backup file
>    Press ENTER or type command to continue

>I don't know if the problem comes from vim or from NetBSD.


It's a problem of all, vim, the FAT filesystem and how NetBSD
tries to work around the FAT limitations.

You use msdosfs without long names (see the substitute
names containing a tilde).

vim saves the original file boot.cfg by renaming it to boot.cfg~. But
that's not a valid MS-DOS filename and instead the substitute boot~1.cfg
is generated. But when vim tries to delete boot.cfg~ again, no such
substitution can be used, because boot~1.cfg could be a different file.
The substitution cannot be reverted.

If you use msdosfs with long names (or better with UTF-8 long names),
this doesn't happen as vim can create a file with the long name
boot.cfg~, the substitute is hidden. And that file can also be deleted.

I'm not sure if you actually mount the filesystem with the '-s' option
to disable long names. I suspect, you don't specify any mode and then
msdosfs tries to guess. If all files follow the short 8.3 name pattern,
then it assumes to have a pre-Win95 filesystem and will automatically
chose the '-s' option, otherwise it will chose '-l'.

Best solution for you is to specify the mount option '-U' (implies -l)
for UTF-8 mode to be compatible with Windows.

A fstab entry would look like:

NAME=efi  /efi   msdos   rw,-U,-M755,-m644       1 2



Home | Main Index | Thread Index | Old Index