FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

file-directory-p

Arguments: pathname &key (follow-symbolic-links t)

Returns t if pathname names a directory and nil if it names a file. nil is also returned if pathname does not exist.

It was intended to change this function so that an error would be signaled if pathname does not exist and for a while the documentation was changed to reflect that, but that change was in fact never made.

The behavior when the pathname argument names a symbolic link depends on the follow-symbolic-links argument. When true (the default), symbolic links are followed and t or nil is returned as the resolved link is or is not a directory. When follow-symbolic-links is nil and pathname names a symbolic link, nil is returned regardless of what the link resolves to (since pathname is a symbolic link, not a directory).

Symbolic link example

;; Suppose we have:
$ ls -ld foo tmp
lrwxrwxrwx  1 ueer ftp    3 Feb  4 14:48 foo -< tmp/
drwxr-xr-x. 7 user ftp 4096 Feb  1 12:47 tmp/
$ 

;; In Lisp we have:
;;
cl-user(3): (file-directory-p "foo" :follow-symbolic-links nil)
nil
cl-user(4): (file-directory-p "foo" :follow-symbolic-links t)
t
;; :follow-symbolic-links defaults to t:
cl-user(5): (file-directory-p "foo") 
t

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version