3bcbaa7244351747e8fd86fd3aaf3e380ee0c339
[platform/upstream/coreutils.git] / tests / mv / vfat
1 #!/bin/sh
2 # This is just for the record.
3 # This test is not run.
4
5 exit 0
6
7 cat <<\EOF
8
9 Prior to 5.0.91, ...
10
11 The problem:
12   On a VFAT file system with coreutils-5.0.90, `mv FOO foo' removes the
13   sole copy of the file named by both the source and destination arguments.
14
15 Demonstrate the problem, as root:
16
17 cd /tmp                                    \
18   && dd if=/dev/zero of=1 bs=8192 count=50 \
19   && mkdir mnt && mkfs -t vfat 1           \
20   && mount -oloop 1 mnt && cd mnt          \
21   && printf something important > foo      \
22   && mv foo FOO
23 test -f FOO && echo PASS-1 || echo FAIL-1
24 ln foo bar
25 mv foo FOO
26 test -f FOO && echo PASS-2 || echo FAIL-2
27
28 And in case you actually do the above, you can do this to clean up:
29
30   cd /tmp && umount /tmp/mnt && rm -r 1 mnt
31
32 Hey!  Can't create hard links on vfat.
33 The above `ln' evokes an `operation not permitted' failure.
34
35 This demonstrates the same thing with file system type `umsdos'
36 No hard links:
37
38 cd /tmp                                    \
39   && dd if=/dev/zero of=1 bs=8192 count=50 \
40   && mkdir mnt && mkfs -t msdos 1          \
41   && mount -t umsdos -oloop 1 mnt && cd mnt \
42   && printf something important > foo      \
43   && mv foo FOO
44 test -f FOO && echo PASS-1 || echo FAIL-1
45 ln foo bar
46 mv foo FOO
47 test -f FOO && echo PASS-2 || echo FAIL-2
48
49 EOF