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
The following reply was made to PR pkg/59072; it has been noted by GNATS.
From: =?UTF-8?B?RnLDqWTDqXJpYyBGYXViZXJ0ZWF1?= <triaxx@triaxx.online>
To: gnats-bugs%NetBSD.org@localhost
Cc: Michael van Elst <mlelstv%serpens.de@localhost>
Subject: Re: pkg/59072: Can't delete vim backup on NetBSD with msdos
filesystem
Date: Thu, 13 Feb 2025 10:19:51 +0100
> 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
Your suspicion is right, I didn't specify any mode to mount the involved
msdos filesystem.
I remount my partition with the suggested options:
# umount /mnt/boot
# mount -tmsdos -orw,-U,-M755,-m644 /dev/dk2 /mnt/boot
I create a file with a long name:
# touch /mnt/boot/toolongfilename
But the file name is still truncated:
# ls /mnt/boot
efi toolon~1
Home |
Main Index |
Thread Index |
Old Index