From 4d67d21bbf2bc0e5c03da53747f70c6f0a30a237 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 24 Oct 2005 08:37:42 +0000 Subject: [PATCH] More informative error message by failure of TRUENAME. The extended syntax is allowed in pathnames as a hack to allow using ':' in file names. --- src/c/pathname.d | 2 ++ src/c/unixfsys.d | 6 +++--- src/clos/conditions.lsp | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/c/pathname.d b/src/c/pathname.d index fbc752983..e6ba58eac 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -693,12 +693,14 @@ coerce_to_file_pathname(cl_object pathname) { pathname = coerce_to_physical_pathname(pathname); pathname = cl_merge_pathnames(1, pathname); +#if 0 #if !defined(cygwin) && !defined(mingw32) && !defined(_MSC_VER) if (pathname->pathname.device != Cnil) FEerror("Device ~S not yet supported.", 1, pathname->pathname.device); if (pathname->pathname.host != Cnil) FEerror("Access to remote files not yet supported.", 0); +#endif #endif return pathname; } diff --git a/src/c/unixfsys.d b/src/c/unixfsys.d index 08a313970..fbf7b5cef 100644 --- a/src/c/unixfsys.d +++ b/src/c/unixfsys.d @@ -161,12 +161,12 @@ si_readlink(cl_object filename) { * current directory */ cl_object -cl_truename(cl_object pathname) +cl_truename(cl_object orig_pathname) { cl_object dir; cl_object previous = current_dir(); - pathname = coerce_to_file_pathname(pathname); + cl_object pathname = coerce_to_file_pathname(orig_pathname); assert_non_wild_pathname(pathname); if (pathname->pathname.directory == Cnil) pathname = merge_pathnames(previous, pathname, @':newest'); @@ -184,7 +184,7 @@ cl_truename(cl_object pathname) filename = si_coerce_to_filename(pathname); kind = file_kind(filename->string.self, FALSE); if (kind == Cnil) { - FEcannot_open(pathname); + FEcannot_open(orig_pathname); #ifdef HAVE_LSTAT } else if (kind == @':link') { filename = si_readlink(filename); diff --git a/src/clos/conditions.lsp b/src/clos/conditions.lsp index d2d7707ce..bb3037690 100644 --- a/src/clos/conditions.lsp +++ b/src/clos/conditions.lsp @@ -547,7 +547,10 @@ returns with NIL." (define-condition file-error (error) ((pathname :INITARG :PATHNAME :READER file-error-pathname)) (:REPORT (lambda (condition stream) - (format stream "Filesystem error with pathname ~S.~%Either the file cannot be accessed or the pathname is not a valid one." + (format stream "Filesystem error with pathname ~S.~%Either + 1) the file does not exist, or + 2) we are not allow to access the file, or + 3) the pathname points to a broken symbolic link." (file-error-pathname condition))))) (define-condition package-error (error)