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