Re: Wishing rmdir had a prompt

2019-10-23 Thread sunnycemetery

On 2019-09-02 17:22, Bernhard Voelker wrote:
 Just recently I've been asked (off-list) why src/true.c needs to have  
 80+ lines while 3 lines would be enough.


This piqued my curiosity.  Obvious comment header, localization, and  
--{help,version} fluff aside, I was not aware of the GNU-specific fringe  
case, outlined on the info page as steps to force true to produce a false  
return value.  It has been added to my list of party gags.




Re: Wishing rmdir had a prompt

2019-09-11 Thread Bernhard Voelker

On 9/11/19 10:29 AM, Lady Aleena wrote:

I thank everyone who got involved with my little wish. I did not mean
for it to explode like this. I am entirely comfortable letting the whole
idea drop since there appears to be little to no support for it. I was
just an idle wish that crossed my mind that I wanted to share.

Again, thank you for reading it and taking the time to respond.


I don't think this discussion "exploded".  Instead, I think asking
for such little wishes like you did is how free software works:
one has an idea, other share their thoughts about it.  And some of such ideas
are considered valuable or some even cool - and easy and overall worthwhile
to add - and therefore make it as a new feature into new versions of the
software.  In other cases like this, the discussion leads to a consent
that existing functionality or alternatives are deemed good enough.

So in this sense: thanks for asking. ;-)

Have a nice day,
Berny




Re: Wishing rmdir had a prompt

2019-09-11 Thread Lady Aleena
I thank everyone who got involved with my little wish. I did not mean 
for it to explode like this. I am entirely comfortable letting the whole 
idea drop since there appears to be little to no support for it. I was 
just an idle wish that crossed my mind that I wanted to share.


Again, thank you for reading it and taking the time to respond.

Have a very nice day!
Lady Aleena

On 2019-09-02 11:22, Bernhard Voelker wrote:

On 9/2/19 10:03 AM, Sami Kerola wrote:

[...] I don't see any problem adding --interactive long
only option.


a) Bloat:
Apart from the --parents option, rmdir(1) is just a simple
wrapper around rmdir(2).
Just recently I've been asked (off-list) why src/true.c needs
to have 80+ lines while 3 lines would be enough.

b) Alternatives:
The case is trivial enough to have some little prompt wrapper around 
it.

E.g. a bit contrived but works:
  $ xargs -p rmdir DIR c) As Kaz already wrote: it's easy enough to re-create an empty 
directory

which has been deleted accidentally.

d) My personal opinion: I'm not in favor of those "do you really want 
to XYZ?"
questions - especially in the case one just explicitly told the tool 
exactly

to "do XYZ".  Similarly, one could argument why not to add it to sleep,
kill, cat, and so on.

Have a nice day,
Berny





Re: Wishing rmdir had a prompt

2019-09-02 Thread Kaz Kylheku (Coreutils)

On 2019-09-02 01:03, Sami Kerola wrote:
I am not a maintainer, but I don't see any problem adding --interactive 
long
only option. Getting a short option may clash with future posix 
requirement,

so I believe they are not handed out without really good reasons.


Fear not; POSIX standardization is not ignorant of significant 
implementations

like those from GNU.

For example, here is a literal quote from Issue 7 (2018) POSIX's awk 
page:


"The undefined behavior resulting from NULs in extended regular 
expressions allows future extensions for the GNU gawk program to process 
binary data."


https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html

"GNU -> GNU Now (mentioned in) Unix"

:)



Re: Wishing rmdir had a prompt

2019-09-02 Thread Bernhard Voelker

On 9/2/19 10:03 AM, Sami Kerola wrote:

[...] I don't see any problem adding --interactive long
only option.


a) Bloat:
Apart from the --parents option, rmdir(1) is just a simple
wrapper around rmdir(2).
Just recently I've been asked (off-list) why src/true.c needs
to have 80+ lines while 3 lines would be enough.

b) Alternatives:
The case is trivial enough to have some little prompt wrapper around it.
E.g. a bit contrived but works:
  $ xargs -p rmdir DIR 

Re: Wishing rmdir had a prompt

2019-09-02 Thread Sami Kerola
On Mon, 2 Sep 2019 at 05:50, Kaz Kylheku (Coreutils)
<962-396-1...@kylheku.com> wrote:
>
> On 2019-09-01 17:50, Leslie S Satenstein via GNU coreutils General
> Discussion wrote:
> > rmdir -i
>
> I don't see this in a fairly recent GNU Coreutils 8.28 installation.
> Must be very new?

I think '-i, --interactive' was more of a proposal what option is needed than
feedback how use command. Currently implemented options are below.

http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/rmdir.c#n56

> There is some justification for such a thing. Though it may seem that
> accidental
> deletion of empty directories is easy to restore by recreating them,
> that does not
> put the file system back in the pre-deleted state. The modification
> timestamps of
> parent directories are tweaked, and new empty directories come up with
> their own
> modification timestamps as well as different inode numbers, permissions,
> group and user
> ownerships and such. There is no substitute to not deleting something;
> what comes close
> is recovering it from a backup.

Unrelated to this request there's been times when I wish tar would have a
way to 'extract' only meta-data, such as permissions and ownership, but not
update file content.  This would be handy when wanting to recover from
accidental sudo chown -R /usr/ run or something of that sort.

While on it being able to create tar file that contains only meta info would
make permission revert quite interesting, and hopefully lightweight. But
that is a totally new file format and miles away off topic what was requested
originally. So let me add my two pennies to that discussion.

> prompt me before removals

I am not a maintainer, but I don't see any problem adding --interactive long
only option. Getting a short option may clash with future posix requirement,
so I believe they are not handed out without really good reasons.

-- 
Sami Kerola
http://www.iki.fi/kerolasa/



Re: Wishing rmdir had a prompt

2019-09-01 Thread Kaz Kylheku (Coreutils)
On 2019-09-01 17:50, Leslie S Satenstein via GNU coreutils General 
Discussion wrote:

rmdir -i


I don't see this in a fairly recent GNU Coreutils 8.28 installation. 
Must be very new?


There is some justification for such a thing. Though it may seem that 
accidental
deletion of empty directories is easy to restore by recreating them, 
that does not
put the file system back in the pre-deleted state. The modification 
timestamps of
parent directories are tweaked, and new empty directories come up with 
their own
modification timestamps as well as different inode numbers, permissions, 
group and user
ownerships and such. There is no substitute to not deleting something; 
what comes close

is recovering it from a backup.




Re: Wishing rmdir had a prompt

2019-09-01 Thread Leslie S Satenstein via GNU coreutils General Discussion
rmdir -i 


Regards 
 Leslie
 Leslie Satenstein
Montréal Québec, Canada

 

On Sunday, September 1, 2019, 7:38:28 p.m. GMT-4, Lady Aleena 
 wrote:  
 
 Hello.

I would love to see a -i added to rmdir to prompt me before removals of 
empty directories like rm has. It would give me another moment to think 
"Do I really want to remove this?".

This is just a wishful thought.

Thank you for reading,
Lady Aleena