path: root/mcon/U/d_flexfnam.U
diff options
authorManoj Srivastava <>2003-12-01 17:11:15 +0000
committerManoj Srivastava <>2003-12-01 17:11:15 +0000
commit371472d9fb6a936149b105a6563a0550d35bdf1a (patch)
tree6d23751e44a7dddf4e29918551f1ea0513352622 /mcon/U/d_flexfnam.U
Initial import of upstream branch
Initial import of upstream branch git-archimport-id:
Diffstat (limited to 'mcon/U/d_flexfnam.U')
1 files changed, 77 insertions, 0 deletions
diff --git a/mcon/U/d_flexfnam.U b/mcon/U/d_flexfnam.U
new file mode 100644
index 0000000..4e1ddbf
--- /dev/null
+++ b/mcon/U/d_flexfnam.U
@@ -0,0 +1,77 @@
+?RCS: $Id: d_flexfnam.U,v 3.0 1993/08/18 12:06:04 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?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 3.0.
+?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.
+?MAKE:d_flexfnam: cat rm test Setvar
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the FLEXFILENAMES symbol, which
+?S: indicates that the system supports filenames longer than 14 characters.
+?C: This symbol, if defined, indicates that the system supports filenames
+?C: longer than 14 characters.
+?H:#$d_flexfnam FLEXFILENAMES /**/
+?T:first second
+?LINT:set d_flexfnam
+: see if we can have long filenames
+echo " "
+?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.
+rmlist="$rmlist /tmp/cf$$"
+$test -d /tmp/cf$$ || mkdir /tmp/cf$$
+$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.
+ 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.
+ val="$undef"
+ fi
+ fi
+ $cat <<'EOM'
+You can't have filenames longer than 14 chars. You can't even think about them!
+ val="$undef"
+set d_flexfnam
+eval $setvar
+$rm -rf /tmp/cf$$ 123456789abcde*