>Synopsis: mv acts funny when copying to msdosfs
>Arrival-Date: Mon Sep 22 03:30:00 +0000 2008
>Originator: Martin S. Weber
>Release: 4.99.72 / i386
NetBSD agamemnon.entropie.local 4.99.72 NetBSD 4.99.72 (AGAMEMNON) #4: Sat Sep
20 20:45:58 EDT 2008
When mv moves a file it tries to set the utimes etc. on the target file. This
can fail because the target lives on a filesystem which does not support
permissions or seting times, for example msdosfs. It then would complain per
file copied and not remove the source. This only happens though when moving a
whole directory onto such a filesystem. When moving just a file, it would
complain and DO remove the source.
dd if=/dev/zero of=msdos.bin bs=1m count=10
vnconfig vnd0 /tmp/msdos.bin
mkdir -p mnt
mount -t msdos /dev/vnd0a mnt
mkdir -p dir
chown -R nobody dir
mv dir mnt
echo "? : $?"
[ -d dir ] && echo "dir still exists here..."
[ -d mnt/dir ] && echo "dir also exists there..."
# ? : 1
# dir still exists here...
# dir also exists there...
I'd say beer but..
maybe should have a way to determine features of the target filesystem and then
act accordingly? I.e. not try to set permissions/ownership on a filesystem that
does not support it, not complain, not exit with 1 in that case.