Tizen 2.0 Release
[external/tizen-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 2 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, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # 02110-1301, USA.
21
22 exit 0
23
24 cat <<\EOF
25
26 Prior to 5.0.91, ...
27
28 The problem:
29   On a VFAT file system with coreutils-5.0.90, `mv FOO foo' removes the
30   sole copy of the file named by both the source and destination arguments.
31
32 Demonstrate the problem, as root:
33
34 cd /tmp                                    \
35   && dd if=/dev/zero of=1 bs=8192 count=50 \
36   && mkdir mnt && mkfs -t vfat 1           \
37   && mount -oloop 1 mnt && cd mnt          \
38   && printf something important > foo      \
39   && mv foo FOO
40 test -f FOO && echo PASS-1 || echo FAIL-1
41 ln foo bar
42 mv foo FOO
43 test -f FOO && echo PASS-2 || echo FAIL-2
44
45 And in case you actually do the above, you can do this to clean up:
46
47   cd /tmp && umount /tmp/mnt && rm -r 1 mnt
48
49 Hey!  Can't create hard links on vfat.
50 The above `ln' evokes an `operation not permitted' failure.
51
52 This demonstrates the same thing with file system type `umsdos'
53 No hard links:
54
55 cd /tmp                                    \
56   && dd if=/dev/zero of=1 bs=8192 count=50 \
57   && mkdir mnt && mkfs -t msdos 1          \
58   && mount -t umsdos -oloop 1 mnt && cd mnt \
59   && printf something important > foo      \
60   && mv foo FOO
61 test -f FOO && echo PASS-1 || echo FAIL-1
62 ln foo bar
63 mv foo FOO
64 test -f FOO && echo PASS-2 || echo FAIL-2
65
66 EOF