From: thierry volpiatto Date: Sat, 25 Feb 2012 15:31:07 +0000 (+0100) Subject: * doc/lispref/files.texi: (files-equal-p, file-subdir-of-p): Add documentation. X-Git-Tag: emacs-pretest-24.0.94~17 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=23453255524411eaae5c79d7e4ae6c22f6f05f3f;p=emacs.git * doc/lispref/files.texi: (files-equal-p, file-subdir-of-p): Add documentation. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c6cb488e7d4..deeaa2a28f9 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-02-25 Thierry Volpiatto + + * files.texi (files-equal-p, file-subdir-of-p): New, + add initial documentation. + 2012-02-25 Chong Yidong * files.texi (File Attributes): Document file-selinux-context. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 39e6549f4b9..1fee572a573 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1018,6 +1018,23 @@ a regular file (not a directory, named pipe, terminal, or other I/O device). @end defun +@defun files-equal-p file1 file2 +This function return @code{t} if the files @var{file1} and @var{file2} name +the same file. +Comparison is made with the @code{file-attributes} of both files. +@end defun + +@defun file-subdir-of-p dir1 dir2 +This function return @code{t} if directory @var{dir1} is a subdirectory +of @var{dir2} or if @var{dir1} and @var{dir2} are the same directory. +Arguments @var{dir1} and @var{dir2} must be existing directories, +otherwise, return nil. +Check is done by building a directory name based on equality of differents +components of both directory names, if this resulting directory name +is equal to @var{dir2}, we assume directory @var{dir1} +is a subdirectory of @var{dir2}. +@end defun + @node Truenames @subsection Truenames @cindex truename (of file)