Project

General

Profile

« Previous | Next » 

Revision 12954

lib/sh/util.sh: filesystem: added is_*(), could_be_*()

View differences:

trunk/lib/sh/util.sh
1122 1122

  
1123 1123
#### filesystem
1124 1124

  
1125
could_be_glob() { echo_func; contains_match '\*' "$1"; }
1126

  
1127
is_dir() { echo_func; test -d "$1"; }
1128

  
1129
could_be_dir() { echo_func; ends_with / "$1" || is_dir "$1"; }
1130

  
1131
is_file() { echo_func; test -f "$1"; }
1132

  
1133
could_be_file()
1134
{ echo_func; { ! could_be_dir "$1" && ! could_be_glob "$1";} || is_file "$1"; }
1135

  
1125 1136
alias mkdir='mkdir -p'
1126 1137

  
1127 1138
alias file_size=\

Also available in: Unified diff