717 |
These functions test for permission to access a file in specific ways. |
These functions test for permission to access a file in specific ways. |
718 |
|
|
719 |
@defun file-exists-p filename |
@defun file-exists-p filename |
720 |
This function returns @code{t} if a file named @var{filename} appears to |
This function returns @code{t} if a file named @var{filename} appears |
721 |
exist. This does not mean you can necessarily read the file, only that |
to exist. This does not mean you can necessarily read the file, only |
722 |
you can find out its attributes. (On Unix and GNU/Linux, this is true |
that you can find out its attributes. (On Unix and GNU/Linux, this is |
723 |
if the file exists and you have execute permission on the containing |
true if the file exists and you have execute permission on the |
724 |
directories, regardless of the protection of the file itself.) |
containing directories, regardless of the protection of the file |
725 |
|
itself.) |
726 |
|
|
727 |
If the file does not exist, or if fascist access control policies |
If the file does not exist, or if fascist access control policies |
728 |
prevent you from finding the attributes of the file, this function |
prevent you from finding the attributes of the file, this function |
729 |
returns @code{nil}. |
returns @code{nil}. |
730 |
|
|
731 |
|
Directories are files, so @code{file-exists-p} returns @code{t} when |
732 |
|
given a directory name. However, symbolic links are treated |
733 |
|
specially; @code{file-exists-p} returns @code{t} for a symbolic link |
734 |
|
name only if the target file exists. |
735 |
@end defun |
@end defun |
736 |
|
|
737 |
@defun file-readable-p filename |
@defun file-readable-p filename |
1482 |
This function returns @var{filename}'s final ``extension,'' if any, |
This function returns @var{filename}'s final ``extension,'' if any, |
1483 |
after applying @code{file-name-sans-versions} to remove any |
after applying @code{file-name-sans-versions} to remove any |
1484 |
version/backup part. It returns @code{nil} for extensionless file |
version/backup part. It returns @code{nil} for extensionless file |
1485 |
names such as @file{foo}. If @var{period} is non-nil, then the |
names such as @file{foo}. If @var{period} is non-@code{nil}, then the |
1486 |
returned value includes the period that delimits the extension, and if |
returned value includes the period that delimits the extension, and if |
1487 |
@var{filename} has no extension, the value is @code{""}. If the last |
@var{filename} has no extension, the value is @code{""}. If the last |
1488 |
component of a file name begins with a @samp{.}, that @samp{.} doesn't |
component of a file name begins with a @samp{.}, that @samp{.} doesn't |