Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: d_flexfnam.U 1 2006-08-24 12:32:52Z rmanfredi $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 4.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: d_flexfnam.U,v $ | |
12 | ?RCS: Revision 3.0 1993/08/18 12:06:04 ram | |
13 | ?RCS: Baseline for dist 3.0 netwide release. | |
14 | ?RCS: | |
15 | ?MAKE:d_flexfnam: cat rm test Setvar | |
16 | ?MAKE: -pick add $@ %< | |
17 | ?S:d_flexfnam: | |
18 | ?S: This variable conditionally defines the FLEXFILENAMES symbol, which | |
19 | ?S: indicates that the system supports filenames longer than 14 characters. | |
20 | ?S:. | |
21 | ?C:FLEXFILENAMES: | |
22 | ?C: This symbol, if defined, indicates that the system supports filenames | |
23 | ?C: longer than 14 characters. | |
24 | ?C:. | |
25 | ?H:#$d_flexfnam FLEXFILENAMES /**/ | |
26 | ?H:. | |
27 | ?T:first second | |
28 | ?LINT:set d_flexfnam | |
29 | : see if we can have long filenames | |
30 | echo " " | |
31 | ?X: | |
32 | ?X: We have to test in both /tmp and . because of NFS (remote server may allow | |
33 | ?X: long filenames while the local filesystem cannot support them). If at least | |
34 | ?X: one of those file systems cannot support long filenames, then we assume the | |
35 | ?X: whole system can't. | |
36 | ?X: | |
37 | rmlist="$rmlist /tmp/cf$$" | |
38 | $test -d /tmp/cf$$ || mkdir /tmp/cf$$ | |
39 | first=123456789abcdef | |
40 | second=/tmp/cf$$/$first | |
41 | $rm -f $first $second | |
42 | if (echo hi >$first) 2>/dev/null; then | |
43 | if $test -f 123456789abcde; then | |
44 | echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4 | |
45 | val="$undef" | |
46 | else | |
47 | if (echo hi >$second) 2>/dev/null; then | |
48 | if $test -f /tmp/cf$$/123456789abcde; then | |
49 | $cat <<'EOM' | |
50 | That's peculiar... You can have filenames longer than 14 characters, but only | |
51 | on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems | |
52 | I shall consider your system cannot support long filenames at all. | |
53 | EOM | |
54 | val="$undef" | |
55 | else | |
56 | echo 'You can have filenames longer than 14 characters.' >&4 | |
57 | val="$define" | |
58 | fi | |
59 | else | |
60 | $cat <<'EOM' | |
61 | How confusing! Some of your filesystems are sane enough to allow filenames | |
62 | longer than 14 characters but some others like /tmp can't even think about them. | |
63 | So, for now on, I shall assume your kernel does not allow them at all. | |
64 | EOM | |
65 | val="$undef" | |
66 | fi | |
67 | fi | |
68 | else | |
69 | $cat <<'EOM' | |
70 | You can't have filenames longer than 14 chars. You can't even think about them! | |
71 | EOM | |
72 | val="$undef" | |
73 | fi | |
74 | set d_flexfnam | |
75 | eval $setvar | |
76 | $rm -rf /tmp/cf$$ 123456789abcde* | |
77 |