1 ?RCS: $Id: d_flexfnam.U 1 2006-08-24 12:32:52Z rmanfredi $
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
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.
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.
15 ?MAKE:d_flexfnam: cat rm test Setvar
16 ?MAKE: -pick add $@ %<
18 ?S: This variable conditionally defines the FLEXFILENAMES symbol, which
19 ?S: indicates that the system supports filenames longer than 14 characters.
22 ?C: This symbol, if defined, indicates that the system supports filenames
23 ?C: longer than 14 characters.
25 ?H:#$d_flexfnam FLEXFILENAMES /**/
29 : see if we can have long filenames
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.
37 rmlist="$rmlist /tmp/cf$$"
38 $test -d /tmp/cf$$ || mkdir /tmp/cf$$
40 second=/tmp/cf$$/$first
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
47 if (echo hi >$second) 2>/dev/null; then
48 if $test -f /tmp/cf$$/123456789abcde; then
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.
56 echo 'You can have filenames longer than 14 characters.' >&4
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.
70 You can't have filenames longer than 14 chars. You can't even think about them!
76 $rm -rf /tmp/cf$$ 123456789abcde*