comparison src/fileio.c @ 410:7812e9efc1af

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Mon, 26 Aug 1991 19:11:30 +0000
parents 481e29c1e27e
children 8c615e453683
comparison
equal deleted inserted replaced
409:671fceb3316b 410:7812e9efc1af
1361 } 1361 }
1362 return; 1362 return;
1363 } 1363 }
1364 1364
1365 DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 4, 1365 DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 4,
1366 "fCopy file: \nFCopy %s to file: \np", 1366 "fCopy file: \nFCopy %s to file: \np\nP",
1367 "Copy FILE to NEWNAME. Both args must be strings.\n\ 1367 "Copy FILE to NEWNAME. Both args must be strings.\n\
1368 Signals a `file-already-exists' error if file NEWNAME already exists,\n\ 1368 Signals a `file-already-exists' error if file NEWNAME already exists,\n\
1369 unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil.\n\ 1369 unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil.\n\
1370 A number as third arg means request confirmation if NEWNAME already exists.\n\ 1370 A number as third arg means request confirmation if NEWNAME already exists.\n\
1371 This is what happens in interactive use with M-x.\n\ 1371 This is what happens in interactive use with M-x.\n\
1372 Fourth arg non-nil means give the new file the same last-modified time\n\ 1372 Fourth arg KEEP-TIME non-nil means give the new file the same\n\
1373 that the old one has. (This works on only some systems.)") 1373 last-modified time as the old one. (This works on only some systems.)\n\
1374 A prefix arg makes KEEP-TIME non-nil.")
1374 (filename, newname, ok_if_already_exists, keep_date) 1375 (filename, newname, ok_if_already_exists, keep_date)
1375 Lisp_Object filename, newname, ok_if_already_exists, keep_date; 1376 Lisp_Object filename, newname, ok_if_already_exists, keep_date;
1376 { 1377 {
1377 int ifd, ofd, n; 1378 int ifd, ofd, n;
1378 char buf[16 * 1024]; 1379 char buf[16 * 1024];
1954 1955
1955 fd = -1; 1956 fd = -1;
1956 1957
1957 #ifndef APOLLO 1958 #ifndef APOLLO
1958 if (stat (XSTRING (filename)->data, &st) < 0 1959 if (stat (XSTRING (filename)->data, &st) < 0
1959 || (fd = open (XSTRING (filename)->data, 0)) < 0) 1960 || (fd = open (XSTRING (filename)->data, 0)) < 0)
1960 #else 1961 #else
1961 if ((fd = open (XSTRING (filename)->data, 0)) < 0 1962 if ((fd = open (XSTRING (filename)->data, 0)) < 0
1962 || fstat (fd, &st) < 0) 1963 || fstat (fd, &st) < 0)
1963 #endif /* not APOLLO */ 1964 #endif /* not APOLLO */
1964 { 1965 {