My various dotfiles

chap-20.texi 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. @node Files, Streams, Filenames, Top
  2. @chapter Files
  3. @menu
  4. * File System Concepts::
  5. * Files Dictionary::
  6. @end menu
  7. @node File System Concepts, Files Dictionary, Files, Files
  8. @section File System Concepts
  9. @c including concept-files
  10. This section describes the @r{Common Lisp} interface to file systems.
  11. The model used by this interface assumes
  12. that @i{files}
  13. @IGindex{file}
  14. are named by @i{filenames}
  15. @IGindex{filename}
  16. ,
  17. that a @i{filename} can be represented by a @i{pathname} @i{object},
  18. and that given a @i{pathname} a @i{stream}
  19. @IGindex{stream}
  20. can be constructed
  21. that connects to a @i{file} whose @i{filename} it represents.
  22. For information about opening and closing @i{files},
  23. and manipulating their contents, see @ref{Streams}.
  24. Figure 20--1 lists some @i{operators}
  25. that are applicable to @i{files} and directories.
  26. @group
  27. @noindent
  28. @w{ compile-file file-length open }
  29. @w{ delete-file file-position probe-file }
  30. @w{ directory file-write-date rename-file }
  31. @w{ file-author load with-open-file }
  32. @noindent
  33. @w{ Figure 20--1: File and Directory Operations }
  34. @end group
  35. @menu
  36. * Coercion of Streams to Pathnames::
  37. * File Operations on Open and Closed Streams::
  38. * Truenames::
  39. @end menu
  40. @node Coercion of Streams to Pathnames, File Operations on Open and Closed Streams, File System Concepts, File System Concepts
  41. @subsection Coercion of Streams to Pathnames
  42. A @i{stream associated with a file}
  43. @IGindex{stream associated with a file}
  44. is either a @i{file stream}
  45. or a @i{synonym stream} whose target is a @i{stream associated with a file}
  46. @IGindex{stream associated with a file}
  47. .
  48. Such streams can be used as @i{pathname designators}.
  49. Normally, when a @i{stream associated with a file} is used as a
  50. @i{pathname designator}, it denotes the @i{pathname} used to
  51. open the @i{file}; this may be, but is not required to be, the
  52. actual name of the @i{file}.
  53. Some functions, such as @b{truename} and @b{delete-file},
  54. coerce @i{streams} to @i{pathnames} in a different way that
  55. involves referring to the actual @i{file} that is open, which might
  56. or might not be the file whose name was opened originally. Such special
  57. situations are always notated specifically and are not the default.
  58. @node File Operations on Open and Closed Streams, Truenames, Coercion of Streams to Pathnames, File System Concepts
  59. @subsection File Operations on Open and Closed Streams
  60. Many @i{functions} that perform @i{file} operations accept either
  61. @i{open} or @i{closed} @i{streams} as @i{arguments};
  62. see @ref{Stream Arguments to Standardized Functions}.
  63. Of these, the @i{functions} in Figure 20--2 treat @i{open} and
  64. @i{closed} @i{streams} differently.
  65. @group
  66. @noindent
  67. @w{ delete-file file-author probe-file }
  68. @w{ directory file-write-date truename }
  69. @noindent
  70. @w{ Figure 20--2: File Functions that Treat Open and Closed Streams Differently}
  71. @end group
  72. Since treatment of @i{open} @i{streams} by the @i{file system}
  73. may vary considerably between @i{implementations}, however,
  74. a @i{closed} @i{stream} might be the most reliable kind of
  75. @i{argument} for some of these functions---in particular, those in
  76. Figure 20--3. For example, in some @i{file systems},
  77. @i{open} @i{files} are written under temporary names
  78. and not renamed until @i{closed}
  79. and/or are held invisible until @i{closed}.
  80. In general, any code that is intended to be portable should
  81. use such @i{functions} carefully.
  82. @group
  83. @noindent
  84. @w{ directory probe-file truename }
  85. @noindent
  86. @w{ Figure 20--3: File Functions where Closed Streams Might Work Best}
  87. @end group
  88. @node Truenames, , File Operations on Open and Closed Streams, File System Concepts
  89. @subsection Truenames
  90. Many @i{file systems} permit more than one @i{filename} to designate
  91. a particular @i{file}.
  92. Even where multiple names are possible, most @i{file systems} have a convention
  93. for generating a canonical @i{filename} in such situations. Such a canonical
  94. @i{filename} (or the @i{pathname} representing such a @i{filename}) is
  95. called a @i{truename}
  96. @IGindex{truename}
  97. .
  98. The @i{truename} of a @i{file} may differ from other @i{filenames}
  99. for the file because of
  100. symbolic links,
  101. version numbers,
  102. logical device translations in the @i{file system},
  103. @i{logical pathname} translations within @r{Common Lisp},
  104. or other artifacts of the @i{file system}.
  105. The @i{truename} for a @i{file} is often, but not necessarily, unique for
  106. each @i{file}. For instance, a Unix @i{file} with multiple hard links
  107. could have several @i{truenames}.
  108. @menu
  109. * Examples of Truenames::
  110. @end menu
  111. @node Examples of Truenames, , Truenames, Truenames
  112. @subsubsection Examples of Truenames
  113. For example, a DEC TOPS-20 system with @i{files} @t{PS:<JOE>FOO.TXT.1}
  114. and @t{PS:<JOE>FOO.TXT.2} might permit the second @i{file} to be referred
  115. to as @t{PS:<JOE>FOO.TXT.0}, since the ``@t{.0}'' notation denotes ``newest''
  116. version of several @i{files}.
  117. In the same @i{file system}, a ``logical device'' ``@t{JOE:}'' might be
  118. taken to refer to @t{PS:<JOE>}'' and so the names @t{JOE:FOO.TXT.2} or
  119. @t{JOE:FOO.TXT.0} might refer to @t{PS:<JOE>FOO.TXT.2}.
  120. In all of these cases, the @i{truename} of the file would probably be
  121. @t{PS:<JOE>FOO.TXT.2}.
  122. If a @i{file} is a symbolic link to another @i{file} (in a @i{file system}
  123. permitting such a thing), it is conventional for the @i{truename} to be
  124. the canonical name of the @i{file} after any symbolic links have been followed;
  125. that is, it is the canonical name of the @i{file} whose contents would
  126. become available if an @i{input} @i{stream} to that @i{file} were
  127. opened.
  128. In the case of a @i{file} still being created (that is, of an @i{output}
  129. @i{stream} open to such a @i{file}), the exact @i{truename} of the file
  130. might not be known until the @i{stream} is closed. In this case,
  131. the @i{function} @b{truename} might return different values for such a @i{stream}
  132. before and after it was closed. In fact, before it is closed, the name returned
  133. might not even be a valid name in the @i{file system}---for example, while a
  134. file is being written, it might have version @t{:newest} and might only take on
  135. a specific numeric value later when the file is closed even in a @i{file system}
  136. where all files have numeric versions.
  137. @c end of including concept-files
  138. @node Files Dictionary, , File System Concepts, Files
  139. @section Files Dictionary
  140. @c including dict-files
  141. @menu
  142. * directory::
  143. * probe-file::
  144. * ensure-directories-exist::
  145. * truename::
  146. * file-author::
  147. * file-write-date::
  148. * rename-file::
  149. * delete-file::
  150. * file-error::
  151. * file-error-pathname::
  152. @end menu
  153. @node directory, probe-file, Files Dictionary, Files Dictionary
  154. @subsection directory [Function]
  155. @code{directory} @i{pathspec {&key}} @result{} @i{pathnames}
  156. @subsubheading Arguments and Values::
  157. @i{pathspec}---a @i{pathname designator},
  158. which may contain @i{wild} components.
  159. @i{pathnames}---a @i{list} of
  160. @i{physical pathnames}.
  161. @subsubheading Description::
  162. Determines which, if any, @i{files} that are present
  163. in the file system have names matching @i{pathspec},
  164. and returns a
  165. @i{fresh}
  166. @i{list} of @i{pathnames} corresponding to the @i{truenames} of
  167. those @i{files}.
  168. An @i{implementation} may be extended to accept
  169. @i{implementation-defined} keyword arguments to @b{directory}.
  170. @subsubheading Affected By::
  171. The host computer's file system.
  172. @subsubheading Exceptional Situations::
  173. If the attempt to obtain a directory listing is not successful,
  174. an error of @i{type} @b{file-error} is signaled.
  175. @subsubheading See Also::
  176. @b{pathname},
  177. @b{logical-pathname},
  178. @ref{ensure-directories-exist}
  179. ,
  180. @ref{File System Concepts},
  181. @ref{File Operations on Open and Closed Streams},
  182. @ref{Pathnames as Filenames}
  183. @subsubheading Notes::
  184. If the @i{pathspec} is not @i{wild},
  185. the resulting list will contain either zero or one elements.
  186. @r{Common Lisp} specifies ``{&key}'' in the argument list to @b{directory}
  187. even though no @i{standardized} keyword arguments to @b{directory} are defined.
  188. ``@t{:allow-other-keys t}''
  189. may be used in @i{conforming programs} in order to quietly ignore any
  190. additional keywords which are passed by the program but not supported
  191. by the @i{implementation}.
  192. @node probe-file, ensure-directories-exist, directory, Files Dictionary
  193. @subsection probe-file [Function]
  194. @code{probe-file} @i{pathspec} @result{} @i{truename}
  195. @subsubheading Arguments and Values::
  196. @i{pathspec}---a @i{pathname designator}.
  197. @i{truename}---a @i{physical pathname} or @b{nil}.
  198. @subsubheading Description::
  199. @b{probe-file} tests whether a file exists.
  200. @b{probe-file} returns @i{false} if there is no file named @i{pathspec},
  201. and otherwise returns the @i{truename} of @i{pathspec}.
  202. If the @i{pathspec} @i{designator} is an open @i{stream},
  203. then @b{probe-file} produces the @i{truename} of its associated @i{file}.
  204. If @i{pathspec} is a @i{stream}, whether open or closed,
  205. it is coerced to a @i{pathname} as if by the @i{function} @b{pathname}.
  206. @subsubheading Affected By::
  207. The host computer's file system.
  208. @subsubheading Exceptional Situations::
  209. An error of @i{type} @b{file-error} is signaled if @i{pathspec} is @i{wild}.
  210. An error of @i{type} @b{file-error} is signaled
  211. if the @i{file system} cannot perform the requested operation.
  212. @subsubheading See Also::
  213. @ref{truename}
  214. ,
  215. @ref{open}
  216. ,
  217. @ref{ensure-directories-exist}
  218. ,
  219. @b{pathname},
  220. @b{logical-pathname},
  221. @ref{File System Concepts},
  222. @ref{File Operations on Open and Closed Streams},
  223. @ref{Pathnames as Filenames}
  224. @node ensure-directories-exist, truename, probe-file, Files Dictionary
  225. @subsection ensure-directories-exist [Function]
  226. @code{ensure-directories-exist} @i{pathspec {&key} verbose} @result{} @i{pathspec, created}
  227. @subsubheading Arguments and Values::
  228. @i{pathspec}---a @i{pathname designator}.
  229. @i{verbose}---a @i{generalized boolean}.
  230. @i{created}---a @i{generalized boolean}.
  231. @subsubheading Description::
  232. Tests whether the directories containing the specified @i{file} actually exist,
  233. and attempts to create them if they do not.
  234. If the containing directories do not exist and if @i{verbose} is @i{true},
  235. then the @i{implementation} is permitted (but not required)
  236. to perform output to @i{standard output} saying what directories were created.
  237. If the containing directories exist, or if @i{verbose} is @i{false},
  238. this function performs no output.
  239. The @i{primary value} is the given @i{pathspec} so that this operation can
  240. be straightforwardly composed with other file manipulation expressions.
  241. The @i{secondary value}, @i{created}, is @i{true} if any directories were
  242. created.
  243. @subsubheading Affected By::
  244. The host computer's file system.
  245. @subsubheading Exceptional Situations::
  246. An error of @i{type} @b{file-error} is signaled if the host, device, or directory
  247. part of @i{pathspec} is @i{wild}.
  248. If the directory creation attempt is not successful,
  249. an error of @i{type} @b{file-error} is signaled;
  250. if this occurs,
  251. it might be the case that none, some, or all
  252. of the requested creations have actually occurred
  253. within the @i{file system}.
  254. @subsubheading See Also::
  255. @ref{probe-file}
  256. ,
  257. @ref{open}
  258. ,
  259. @ref{Pathnames as Filenames}
  260. @node truename, file-author, ensure-directories-exist, Files Dictionary
  261. @subsection truename [Function]
  262. @code{truename} @i{filespec} @result{} @i{truename}
  263. @subsubheading Arguments and Values::
  264. @i{filespec}---a @i{pathname designator}.
  265. @i{truename}---a @i{physical pathname}.
  266. @subsubheading Description::
  267. @b{truename} tries to find the @i{file} indicated by
  268. @i{filespec} and returns its @i{truename}.
  269. If the @i{filespec} @i{designator} is an open @i{stream},
  270. its associated @i{file} is used.
  271. If @i{filespec} is a @i{stream},
  272. @b{truename} can be used whether the @i{stream}
  273. is open or closed. It is permissible for @b{truename}
  274. to return more specific information after the @i{stream}
  275. is closed than when the @i{stream} was open.
  276. If @i{filespec} is a @i{pathname}
  277. it represents the name used to open the file. This may be, but is
  278. not required to be, the actual name of the file.
  279. @subsubheading Examples::
  280. @example
  281. ;; An example involving version numbers. Note that the precise nature of
  282. ;; the truename is implementation-dependent while the file is still open.
  283. (with-open-file (stream ">vistor>test.text.newest")
  284. (values (pathname stream)
  285. (truename stream)))
  286. @result{} #P"S:>vistor>test.text.newest", #P"S:>vistor>test.text.1"
  287. @i{OR}@result{} #P"S:>vistor>test.text.newest", #P"S:>vistor>test.text.newest"
  288. @i{OR}@result{} #P"S:>vistor>test.text.newest", #P"S:>vistor>_temp_._temp_.1"
  289. ;; In this case, the file is closed when the truename is tried, so the
  290. ;; truename information is reliable.
  291. (with-open-file (stream ">vistor>test.text.newest")
  292. (close stream)
  293. (values (pathname stream)
  294. (truename stream)))
  295. @result{} #P"S:>vistor>test.text.newest", #P"S:>vistor>test.text.1"
  296. ;; An example involving TOP-20's implementation-dependent concept
  297. ;; of logical devices -- in this case, "DOC:" is shorthand for
  298. ;; "PS:<DOCUMENTATION>" ...
  299. (with-open-file (stream "CMUC::DOC:DUMPER.HLP")
  300. (values (pathname stream)
  301. (truename stream)))
  302. @result{} #P"CMUC::DOC:DUMPER.HLP", #P"CMUC::PS:<DOCUMENTATION>DUMPER.HLP.13"
  303. @end example
  304. @subsubheading Exceptional Situations::
  305. An error of @i{type} @b{file-error} is signaled if an appropriate @i{file}
  306. cannot be located within the @i{file system} for the given @i{filespec},
  307. or if the @i{file system} cannot perform the requested operation.
  308. An error of @i{type} @b{file-error} is signaled if @i{pathname} is @i{wild}.
  309. @subsubheading See Also::
  310. @b{pathname},
  311. @b{logical-pathname},
  312. @ref{File System Concepts},
  313. @ref{Pathnames as Filenames}
  314. @subsubheading Notes::
  315. @b{truename} may be used to account for any @i{filename} translations
  316. performed by the @i{file system}.
  317. @node file-author, file-write-date, truename, Files Dictionary
  318. @subsection file-author [Function]
  319. @code{file-author} @i{pathspec} @result{} @i{author}
  320. @subsubheading Arguments and Values::
  321. @i{pathspec}---a @i{pathname designator}.
  322. @i{author}---a @i{string} or @b{nil}.
  323. @subsubheading Description::
  324. Returns a @i{string} naming the author of the @i{file} specified by @i{pathspec},
  325. or @b{nil} if the author's name cannot be determined.
  326. @subsubheading Examples::
  327. @example
  328. (with-open-file (stream ">relativity>general.text")
  329. (file-author s))
  330. @result{} "albert"
  331. @end example
  332. @subsubheading Affected By::
  333. The host computer's file system.
  334. Other users of the @i{file} named by @i{pathspec}.
  335. @subsubheading Exceptional Situations::
  336. An error of @i{type} @b{file-error} is signaled if @i{pathspec} is @i{wild}.
  337. An error of @i{type} @b{file-error} is signaled
  338. if the @i{file system} cannot perform the requested operation.
  339. @subsubheading See Also::
  340. @b{pathname},
  341. @b{logical-pathname},
  342. @ref{File System Concepts},
  343. @ref{Pathnames as Filenames}
  344. @node file-write-date, rename-file, file-author, Files Dictionary
  345. @subsection file-write-date [Function]
  346. @code{file-write-date} @i{pathspec} @result{} @i{date}
  347. @subsubheading Arguments and Values::
  348. @i{pathspec}---a @i{pathname designator}.
  349. @i{date}---a @i{universal time} or @b{nil}.
  350. @subsubheading Description::
  351. Returns a @i{universal time} representing the time at which the @i{file}
  352. specified by @i{pathspec} was last written (or created),
  353. or returns @b{nil} if such a time cannot be determined.
  354. @subsubheading Examples::
  355. @example
  356. (with-open-file (s "noel.text"
  357. :direction :output :if-exists :error)
  358. (format s "~&Dear Santa,~2
  359. Please leave lots of toys.~2
  360. ~2
  361. (truename s))
  362. @result{} #P"CUPID:/susan/noel.text"
  363. (with-open-file (s "noel.text")
  364. (file-write-date s))
  365. @result{} 2902600800
  366. @end example
  367. @subsubheading Affected By::
  368. The host computer's file system.
  369. @subsubheading Exceptional Situations::
  370. An error of @i{type} @b{file-error} is signaled if @i{pathspec} is @i{wild}.
  371. An error of @i{type} @b{file-error} is signaled
  372. if the @i{file system} cannot perform the requested operation.
  373. @subsubheading See Also::
  374. @ref{Universal Time},
  375. @ref{Pathnames as Filenames}
  376. @node rename-file, delete-file, file-write-date, Files Dictionary
  377. @subsection rename-file [Function]
  378. @code{rename-file} @i{filespec new-name} @result{} @i{defaulted-new-name, old-truename, new-truename}
  379. @subsubheading Arguments and Values::
  380. @i{filespec}---a @i{pathname designator}.
  381. @i{new-name}---a @i{pathname designator}
  382. other than a @i{stream}.
  383. @i{defaulted-new-name}---a @i{pathname}
  384. @i{old-truename}---a @i{physical pathname}.
  385. @i{new-truename}---a @i{physical pathname}.
  386. @subsubheading Description::
  387. @b{rename-file} modifies the file system in such a way
  388. that the file indicated by @i{filespec} is renamed to
  389. @i{defaulted-new-name}.
  390. It is an error to specify a filename containing a @i{wild} component,
  391. for @i{filespec} to contain a @b{nil} component where the file system does
  392. not permit a @b{nil} component, or for the result of defaulting missing
  393. components of @i{new-name} from @i{filespec} to contain a @b{nil} component
  394. where the file system does not permit a @b{nil} component.
  395. If @i{new-name} is a @i{logical pathname},
  396. @b{rename-file} returns a @i{logical pathname} as its @i{primary value}.
  397. @b{rename-file}
  398. returns three values if successful. The @i{primary value}, @i{defaulted-new-name},
  399. is the resulting name which is composed of
  400. @i{new-name} with any missing components filled in by performing
  401. a @b{merge-pathnames} operation using @i{filespec} as the defaults.
  402. The @i{secondary value}, @i{old-truename},
  403. is the @i{truename} of the @i{file} before it was renamed.
  404. The @i{tertiary value}, @i{new-truename},
  405. is the @i{truename} of the @i{file} after it was renamed.
  406. If the @i{filespec} @i{designator} is an open @i{stream},
  407. then the @i{stream} itself and the file associated with it are
  408. affected (if the @i{file system} permits).
  409. @subsubheading Examples::
  410. @example
  411. ;; An example involving logical pathnames.
  412. (with-open-file (stream "sys:chemistry;lead.text"
  413. :direction :output :if-exists :error)
  414. (princ "eureka" stream)
  415. (values (pathname stream) (truename stream)))
  416. @result{} #P"SYS:CHEMISTRY;LEAD.TEXT.NEWEST", #P"Q:>sys>chem>lead.text.1"
  417. (rename-file "sys:chemistry;lead.text" "gold.text")
  418. @result{} #P"SYS:CHEMISTRY;GOLD.TEXT.NEWEST",
  419. #P"Q:>sys>chem>lead.text.1",
  420. #P"Q:>sys>chem>gold.text.1"
  421. @end example
  422. @subsubheading Exceptional Situations::
  423. If the renaming operation is not successful, an error of @i{type} @b{file-error} is signaled.
  424. An error of @i{type} @b{file-error} might be signaled if @i{filespec} is @i{wild}.
  425. @subsubheading See Also::
  426. @ref{truename}
  427. ,
  428. @b{pathname},
  429. @b{logical-pathname},
  430. @ref{File System Concepts},
  431. @ref{Pathnames as Filenames}
  432. @node delete-file, file-error, rename-file, Files Dictionary
  433. @subsection delete-file [Function]
  434. @code{delete-file} @i{filespec} @result{} @i{@b{t}}
  435. @subsubheading Arguments and Values::
  436. @i{filespec}---a @i{pathname designator}.
  437. @subsubheading Description::
  438. Deletes the @i{file} specified by @i{filespec}.
  439. If the @i{filespec} @i{designator} is an open @i{stream},
  440. then @i{filespec} and the file associated with it are affected
  441. (if the file system permits),
  442. in which case @i{filespec} might be closed immediately,
  443. and the deletion might be immediate or delayed until @i{filespec} is explicitly closed,
  444. depending on the requirements of the file system.
  445. It is @i{implementation-dependent} whether an attempt
  446. to delete a nonexistent file is considered to be successful.
  447. @b{delete-file} returns @i{true} if it succeeds,
  448. or signals an error of @i{type} @b{file-error} if it does not.
  449. The consequences are undefined
  450. if @i{filespec} has a @i{wild} component,
  451. or if @i{filespec} has a @b{nil} component
  452. and the file system does not permit a @b{nil} component.
  453. @subsubheading Examples::
  454. @example
  455. (with-open-file (s "delete-me.text" :direction :output :if-exists :error))
  456. @result{} NIL
  457. (setq p (probe-file "delete-me.text")) @result{} #P"R:>fred>delete-me.text.1"
  458. (delete-file p) @result{} T
  459. (probe-file "delete-me.text") @result{} @i{false}
  460. (with-open-file (s "delete-me.text" :direction :output :if-exists :error)
  461. (delete-file s))
  462. @result{} T
  463. (probe-file "delete-me.text") @result{} @i{false}
  464. @end example
  465. @subsubheading Exceptional Situations::
  466. If the deletion operation is not successful, an error of @i{type} @b{file-error} is signaled.
  467. An error of @i{type} @b{file-error} might be signaled if @i{filespec} is @i{wild}.
  468. @subsubheading See Also::
  469. @b{pathname},
  470. @b{logical-pathname},
  471. @ref{File System Concepts},
  472. @ref{Pathnames as Filenames}
  473. @node file-error, file-error-pathname, delete-file, Files Dictionary
  474. @subsection file-error [Condition Type]
  475. @subsubheading Class Precedence List::
  476. @b{file-error},
  477. @b{error},
  478. @b{serious-condition},
  479. @b{condition},
  480. @b{t}
  481. @subsubheading Description::
  482. The @i{type} @b{file-error} consists of error conditions that occur during
  483. an attempt to open or close a file, or during some low-level transactions
  484. with a file system. The ``offending pathname'' is initialized by
  485. the @t{:pathname} initialization argument to @b{make-condition}, and is @i{accessed}
  486. by the @i{function} @b{file-error-pathname}.
  487. @subsubheading See Also::
  488. {file-error-pathname},
  489. @ref{open}
  490. ,
  491. @ref{probe-file}
  492. ,
  493. @ref{directory}
  494. ,
  495. @ref{ensure-directories-exist}
  496. @node file-error-pathname, , file-error, Files Dictionary
  497. @subsection file-error-pathname [Function]
  498. @code{file-error-pathname} @i{condition} @result{} @i{pathspec}
  499. @subsubheading Arguments and Values::
  500. @i{condition}---a @i{condition} of @i{type} @b{file-error}.
  501. @i{pathspec}---a @i{pathname designator}.
  502. @subsubheading Description::
  503. Returns the ``offending pathname'' of a @i{condition} of @i{type} @b{file-error}.
  504. @subsubheading Exceptional Situations::
  505. @subsubheading See Also::
  506. @b{file-error},
  507. @ref{Conditions}
  508. @c end of including dict-files
  509. @c %**end of chapter