comparison lispref/files.texi @ 71003:7733ed75db62

* files.texi (Changing Files): Document updated argument list for copy-file.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 27 May 2006 14:35:49 +0000
parents 9a270d0b2af7
children f1944cae0a63 a8190f7e546e
comparison
equal deleted inserted replaced
71002:280984b0f4da 71003:7733ed75db62
1429 continues to have those names. In fact, adding the name @var{newname} 1429 continues to have those names. In fact, adding the name @var{newname}
1430 with @code{add-name-to-file} and then deleting @var{filename} has the 1430 with @code{add-name-to-file} and then deleting @var{filename} has the
1431 same effect as renaming, aside from momentary intermediate states. 1431 same effect as renaming, aside from momentary intermediate states.
1432 @end deffn 1432 @end deffn
1433 1433
1434 @deffn Command copy-file oldname newname &optional ok-if-exists time mustbenew 1434 @deffn Command copy-file oldname newname &optional ok-if-exists time preserve-uid-gid
1435 This command copies the file @var{oldname} to @var{newname}. An 1435 This command copies the file @var{oldname} to @var{newname}. An
1436 error is signaled if @var{oldname} does not exist. If @var{newname} 1436 error is signaled if @var{oldname} does not exist. If @var{newname}
1437 names a directory, it copies @var{oldname} into that directory, 1437 names a directory, it copies @var{oldname} into that directory,
1438 preserving its final name component. 1438 preserving its final name component.
1439 1439
1440 If @var{time} is non-@code{nil}, then this function gives the new file 1440 If @var{time} is non-@code{nil}, then this function gives the new file
1441 the same last-modified time that the old one has. (This works on only 1441 the same last-modified time that the old one has. (This works on only
1442 some operating systems.) If setting the time gets an error, 1442 some operating systems.) If setting the time gets an error,
1443 @code{copy-file} signals a @code{file-date-error} error. 1443 @code{copy-file} signals a @code{file-date-error} error. In an
1444 interactive call, a prefix argument specifies a non-@code{nil} value
1445 for @var{time}.
1444 1446
1445 This function copies the file modes, too. 1447 This function copies the file modes, too.
1446 1448
1447 In an interactive call, a prefix argument specifies a non-@code{nil} 1449 If argument @var{preserve-uid-gid} is @code{nil}, we let the operating
1448 value for @var{time}. 1450 system decide the user and group ownership of the new file (this is
1449 1451 usually set to the user running Emacs). If @var{preserve-uid-gid} is
1450 The argument @var{mustbenew} controls whether an existing file can be 1452 non-@code{nil}, we attempt to copy the user and group ownership of the
1451 overwritten. It works like the similarly-named argument of 1453 file. This works only on some operating systems, and only if you have
1452 @code{write-region} (@pxref{Writing to Files, mustbenew}). 1454 the correct permissions to do so.
1453 @end deffn 1455 @end deffn
1454 1456
1455 @deffn Command make-symbolic-link filename newname &optional ok-if-exists 1457 @deffn Command make-symbolic-link filename newname &optional ok-if-exists
1456 @pindex ln 1458 @pindex ln
1457 @kindex file-already-exists 1459 @kindex file-already-exists