unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34338: 26.1; delete-file return codes and failures
@ 2019-02-05 21:47 Boruch Baum
  2019-02-06  8:24 ` Michael Albinus
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Boruch Baum @ 2019-02-05 21:47 UTC (permalink / raw)
  To: 34338

Subject: 26.1; delete-file return codes and failures

Currently:

A1) When delete-file successfully deletes a file, the function returns
    nil, not t.

A2) When the file does not exist, the function returns the same
    value - nil.

A3) When the file has been chmod'ed -w, the function performs the
    operation, with no regard to any option to emulate or not emulate 'rm
    -f', and also returns the identical value - nil.

A4) When either the file's containing folder is chmod'ed -x, or the file
    is chattr'ed +i, the function crashes.


I'd like to suggest:

  delete-file FILE &optional NOERROR FORCE

B1) return t on success

B2) raise an error when (not NOERROR) and:

  B2.1) file doesn't exist

  B2.2) (and (chmod -w) (not FORCE))

  B2.3) another form of permission denial is encountered

B3) return nil when NOERROR and:

  B2.1) file doesn't exist

  B2.2)  another form of permission denial is encountered


C) maybe log the exact error or reason for nil to *Messages*.



In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.2)
 of 2018-12-26, modified by Debian built on x86-ubc-01
System Description:	Devuan GNU/Linux 2.0.0 (ascii)

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-11-08 13:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-05 21:47 bug#34338: 26.1; delete-file return codes and failures Boruch Baum
2019-02-06  8:24 ` Michael Albinus
2019-02-06  9:35   ` Boruch Baum
2019-02-06 16:19 ` Eli Zaretskii
2019-02-06 21:02   ` Boruch Baum
2019-02-07  3:36     ` Eli Zaretskii
2019-02-07  5:14       ` Boruch Baum
2019-10-09 11:48 ` Stefan Kangas
2019-10-30 21:07   ` Stefan Kangas
2019-10-30 22:22     ` Boruch Baum
2019-10-30 22:52       ` Stefan Kangas
2019-10-31  1:33         ` Boruch Baum
2019-10-31 14:32           ` Eli Zaretskii
2019-11-01  9:34             ` Boruch Baum
2019-11-01  9:55               ` Eli Zaretskii
2019-11-08 13:00           ` Stefan Kangas
2019-10-31 14:01       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).