adtools / coreutils

GNU coreutils for AmigaOS
GNU General Public License v3.0
6 stars 2 forks source link

rm: refuses to remove dirs that are not empty (recursive flag used) #1

Open raziel- opened 6 years ago

raziel- commented 6 years ago

AmigaOS4.1 FinalEdition Update 1 rm (GNU coreutils) 8.27

e.g. directory has a subdirectory which has files in it (files flagged as deletable and read/writable)

rm -f -r directory/subdirectory rm: cannot remove 'directory/subdirectory': Directory not empty

Doesn't matter if it's started from within a makefile, an sh shell or an Amiga shell.

Maybe i'm doing something wrong, but shouldn't the -r recursive flag take care of all the files inside that subdirectory?

Breaks nearly all "gmake -clean" commands of porting projects.

hnl commented 6 years ago

Hello Hubert. Will try to have a look today. Just to make sure that I can test it in the same environment as you... on what filesystem is the directory placed?

raziel- commented 6 years ago

Hi Henning,

 

thanks a lot for getting back to me.

 

All of my partitions (except the Boot Partition) have SFS/02 (53465302) as FS with a blocksize of 4096.  

Take care,

Hubert

AmigaOS - way to go!

Amiga X1000 - PA6T - 4 GB Radeon HD 7750 - 3 GB

   

Gesendet: Montag, 13. November 2017 um 09:15 Uhr Von: "Henning Lund" notifications@github.com An: adtools/coreutils coreutils@noreply.github.com Cc: "Hubert Maier" raziel_nosgoth@web.de, Author author@noreply.github.com Betreff: Re: [adtools/coreutils] rm: refuses to remove dirs that are not empty (recursive flag used) (#1)

Hello Hubert. Will try to have a look today. Just to make sure that I can test it in the same environment as you... on what filesystem is the directory placed?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

 

hnl commented 6 years ago

thank you

Hypexed commented 5 years ago

I am getting the same here. I try and run a configure script that breaks. I cancel it and if I try and run it again I get this complaint. I have to goto into T: and manually remove the cryptic temp file.

3246251196 commented 2 years ago

I also came across this. You can see the thread in: https://www.amigans.net/modules/xforum/viewtopic.php?topic_id=8655&forum=25. I wanted to fix this issue because I really needed RM -RF to use natively on my Amiga, but:

The result is this: The latest SDK that just came out, 53.34 already comes with the CoreUtils binaries in its C. Before, you had to install CoreUtils from the OS 4 Depot and all the utils went through the CoreUtils binary.

There was no need to even change the source code. For whatever reason when I compiled it myself RM also worked fine so not sure what happened. But, as I say, get the latest SDK 53.34 and you will be fine.

So, I guess there was never a bug in the code after all - why it was causing the error I am not sure.

Hypexed commented 2 years ago

So, I guess there was never a bug in the code after all - why it was causing the error I am not sure.

Well I wouldn't be so sure as I still have the "rm" bug. It may be my fault but I installed the latest SDK. I found the included coreutils were the very old 5.2 version and I updated them to coreutils 8.27 and updated the abc-shell as well from OS4Depot. I ran a configure script which broke the same was it did before, but ran it from Ram Disk and found it broke with path spaces, it is unable to locate Makefile.in, it kept asking for a config.h device and "rm" cannot remove folders.

3246251196 commented 2 years ago

Okay, well I can confirm that the version of RM in this repository when I compiled in (see the thread I linked to above) does not have that bug. You are correct though:

I wonder what all of this means...

Anyway, I am going to recompile version 8 of coretutils with gcc 8 and the latest sdk now.

Hypexed commented 2 years ago

Thanks for confirming that. I've looked into the rm code and it's set by default to not remove empty folders. If it is the original rm code, as it looks like there are no Amiga patches, then it would be relying on the behavior of the rm() function. That would place the blame on the CLib providing that function. Which somehow works fine on Linux but is messed up on OS4. An easy fix would be to enable empty folder removal for recursive option. But finding out what rm() should be doing is the next step.