3 # Use stat to find a writable directory on a file system different from that
4 # of the current directory. If one is found, create a temporary directory
7 test "${CANDIDATE_TMP_DIRS+set}" = set \
8 || CANDIDATE_TMP_DIRS="$TMPDIR /tmp /var/tmp /usr/tmp $HOME"
10 other_partition_tmpdir=
12 dot_mount_point=`stat -c %d .`
13 for d in $CANDIDATE_TMP_DIRS; do
15 # Skip nonexistent directories.
16 test -d $d || continue
18 d_mount_point=`stat -L -c %d $d`
20 # Same partition? Skip it.
21 test x$d_mount_point = x$dot_mount_point && continue
23 # See if we can create a directory in it.
24 if mkdir "$d/tmp$$" > /dev/null 2>&1; then
25 other_partition_tmpdir="$d/tmp$$"
31 if test -z "$other_partition_tmpdir"; then
33 **************************************
34 This test requires a writable directory on a different
35 disk partition, and I couldn't find one. I tried these:
37 Set your environment variable CANDIDATE_TMP_DIRS to make
38 this test use a different list.
39 **************************************
44 test "$VERBOSE" = yes && set -x