view mkinstalldirs @ 53323:a053c8c470f3

Handle non-readable directories. (ido-decorations): Add 9th element for non-readable directory. (ido-directory-nonreadable): New dynamic var. (ido-set-current-directory): Set it. (ido-read-buffer, ido-file-internal): (ido-read-file-name, ido-read-directory-name): Let-bind it. (ido-file-name-all-completions1): Return empty list for non-readable directory. (ido-exhibit): Print [Not readable] if directory is not readable. (ido-expand-directory): New defun (based on tiny fix from Karl Chen). (ido-read-file-name, ido-file-internal, ido-read-directory-name): Use it.
author Kim F. Storm <storm@cua.dk>
date Sat, 27 Dec 2003 21:56:51 +0000
parents 774df19dd335
children f0eb34e60705 746c40973d25
line wrap: on
line source

#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain

# $Id: mkinstalldirs,v 1.1 2001/02/02 13:04:53 gerd Exp $

errstatus=0

for file
do
   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
   shift

   pathcomp=
   for d
   do
     pathcomp="$pathcomp$d"
     case "$pathcomp" in
       -* ) pathcomp=./$pathcomp ;;
     esac

     if test ! -d "$pathcomp"; then
        echo "mkdir $pathcomp" 1>&2

        (mkdir "$pathcomp" && chmod a+rx "$pathcomp") || lasterr=$?

        if test ! -d "$pathcomp"; then
  	  errstatus=$lasterr
        fi
     fi

     pathcomp="$pathcomp/"
   done
done

exit $errstatus

# mkinstalldirs ends here