all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Barman Brakjoller" <brakjoller@hotmail.com>
Subject: bug in built-in function copy-file
Date: Sun, 30 Jun 2002 12:26:24 +0200	[thread overview]
Message-ID: <F483aa4bHjNq9EJytEN0000230e@hotmail.com> (raw)

I think I have found a bug in how copy-file works, at least on my
Windows 2000 system. See below for how to reproduce it:

(The reason for using eshell to describe this "bug" is that it is easy
to follow what I'm doing. I am NOT trying to report an eshell error
here.)

c:/tst $ echo file1 > file1
c:/tst $ echo file2 > file2
c:/tst $ attrib +r file1
c:/tst $ ll
total 0
-r--r--r--   1 Barman B 5               5 jun 30 11:11 file1
-rw-rw-rw-   1 Barman B 5               5 jun 30 11:11 file2
c:/tst $ (copy-file "file2" "file1" t)
Copying file: invalid argument, c:/tst/file2, c:/tst/file1

You may not think this is a bug, but I think so. I think copy-file
should either:

a) report a error message that actually tells the user what the
    problem is (you have to agree that "invalid argument" when trying
    to copy one file to another does not tell the user very much)

b) try to handle the read-only file in the same way that save-buffer
    and write-file does, i.e asking user for permission to overwrite
    the file, then try to temporarily change the file permission bits
    (if the file is not writable), write the file and restore the file
    permission bits.

c) add a new optional argument to copy-file so that it works
something like in b) above, but without the confirmation

I'd think that b) and/or c) would be the preferred way to solve this.

Btw, the same procedure in Linux (using chmod instead of attrib of
course) gives the following error message (which is much better):

Opening output file: permission denied, /tmp/file1

So at least there is an inconsistency in how this is handled on the
two systems I have tested on.

I'm using GNU Emacs 21.1.1 on Windows 2000 and Mandrake Linux 8.0.



_________________________________________________________________
På MSN hittar du det roliga, intressanta och användbara på internet: 
http://www.msn.se

             reply	other threads:[~2002-06-30 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-30 10:26 Barman Brakjoller [this message]
2002-07-01  4:45 ` bug in built-in function copy-file Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2002-06-30 10:21 Barman Brakjoller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F483aa4bHjNq9EJytEN0000230e@hotmail.com \
    --to=brakjoller@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.