Mercurial > emacs
comparison lispref/files.texi @ 51913:3abc365e9d90
(Changing Files): copy-file allows dir as NEWNAME.
(Magic File Names): Specify precedence order of handlers.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 14 Jul 2003 15:53:56 +0000 |
parents | ccbf5ac3316d |
children | 0509fad02151 |
comparison
equal
deleted
inserted
replaced
51912:3abd89560852 | 51913:3abc365e9d90 |
---|---|
1274 @var{newname} already exists. | 1274 @var{newname} already exists. |
1275 @end deffn | 1275 @end deffn |
1276 | 1276 |
1277 @deffn Command copy-file oldname newname &optional ok-if-exists time | 1277 @deffn Command copy-file oldname newname &optional ok-if-exists time |
1278 This command copies the file @var{oldname} to @var{newname}. An | 1278 This command copies the file @var{oldname} to @var{newname}. An |
1279 error is signaled if @var{oldname} does not exist. | 1279 error is signaled if @var{oldname} does not exist. If @var{newname} |
1280 names a directory, it copies @var{oldname} into that directory, | |
1281 preserving its final name component. | |
1280 | 1282 |
1281 If @var{time} is non-@code{nil}, then this function gives the new file | 1283 If @var{time} is non-@code{nil}, then this function gives the new file |
1282 the same last-modified time that the old one has. (This works on only | 1284 the same last-modified time that the old one has. (This works on only |
1283 some operating systems.) If setting the time gets an error, | 1285 some operating systems.) If setting the time gets an error, |
1284 @code{copy-file} signals a @code{file-date-error} error. | 1286 @code{copy-file} signals a @code{file-date-error} error. |
2292 @end example | 2294 @end example |
2293 | 2295 |
2294 @noindent | 2296 @noindent |
2295 The @var{handler} then needs to figure out whether to handle | 2297 The @var{handler} then needs to figure out whether to handle |
2296 @var{filename} or @var{dirname}. | 2298 @var{filename} or @var{dirname}. |
2299 | |
2300 If the specified file name matches more than one handler, the one | |
2301 whose match starts last in the file name gets precedence. This rule | |
2302 is chosen so that handlers for jobs such as uncompression are handled | |
2303 first, before handlers for jobs such as remote file access. | |
2297 | 2304 |
2298 Here are the operations that a magic file name handler gets to handle: | 2305 Here are the operations that a magic file name handler gets to handle: |
2299 | 2306 |
2300 @ifnottex | 2307 @ifnottex |
2301 @noindent | 2308 @noindent |