# $EPIC: fexist.txt,v 1.4 2008/05/28 19:46:15 jnelson Exp $ ======Synopsis:====== $__fexist__(%%%%) \\ $__fexist__(%%"" %%) ======Technical:====== * The %%%% argument is a [[what is a word|dword]] which is different from most function arguments. * In the first case, %%%% is a single extended word (you may surround it with double quotes if it contains spaces). Any further arguments are ignored. * In the second case, the first argument is an empty string, and the rest of the arguments are taken as a filename literally. Do not backslash or double quote anything in%% %%. * Tilde-expansion is supported in both forms, both "~/file" for files in your home directory and "~user/file" for files in someone else's home directory. * If %%%% is not a symbolic link, it exists, and you have read access to it, the return value is 1. * If %%%% is a symbolic link and the file it points to exists, and you have read access to it, the return value is 1. * In the other cases (the file doesn't exist, or you can't read it), the return value is -1. ======Practical:====== This function is used when you want to see if a particular file exists. This could be useful to make sure a file is present before trying to load it. This function does not return 0! ======Returns:====== -1 file does not exist or is not readable by you. 1 file exists and you can read it. ======Examples:====== $fexist(/etc/passwd) probably will return 1 $fexist(~/.ircrc) probably will return 1 too $fexist(fake_file) returns -1 ======History:====== This function first appeared in EPIC3pre7.