Update all copyright notices to use the newer form.
[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 # Copyright (C) 2003 Free Software Foundation, Inc.
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 exit 0
21
22 cat <<\EOF
23
24 Prior to 5.0.91, ...
25
26 The problem:
27   On a VFAT file system with coreutils-5.0.90, `mv FOO foo' removes the
28   sole copy of the file named by both the source and destination arguments.
29
30 Demonstrate the problem, as root:
31
32 cd /tmp                                    \
33   && dd if=/dev/zero of=1 bs=8192 count=50 \
34   && mkdir mnt && mkfs -t vfat 1           \
35   && mount -oloop 1 mnt && cd mnt          \
36   && printf something important > foo      \
37   && mv foo FOO
38 test -f FOO && echo PASS-1 || echo FAIL-1
39 ln foo bar
40 mv foo FOO
41 test -f FOO && echo PASS-2 || echo FAIL-2
42
43 And in case you actually do the above, you can do this to clean up:
44
45   cd /tmp && umount /tmp/mnt && rm -r 1 mnt
46
47 Hey!  Can't create hard links on vfat.
48 The above `ln' evokes an `operation not permitted' failure.
49
50 This demonstrates the same thing with file system type `umsdos'
51 No hard links:
52
53 cd /tmp                                    \
54   && dd if=/dev/zero of=1 bs=8192 count=50 \
55   && mkdir mnt && mkfs -t msdos 1          \
56   && mount -t umsdos -oloop 1 mnt && cd mnt \
57   && printf something important > foo      \
58   && mv foo FOO
59 test -f FOO && echo PASS-1 || echo FAIL-1
60 ln foo bar
61 mv foo FOO
62 test -f FOO && echo PASS-2 || echo FAIL-2
63
64 EOF