News for hackers. Stuff that matters.
Re:Uutils: an attempt at writing cross-platform CLI utilitie... by raverbashing on Monday December 06, 2021 @01:15AM (#29456744)
So it doesn't work for cases where it shouldn't work. And it errors out but doesn't do anything stupid

I don't see the problem for something that was just released as a very preliminary version

(Though I don't know where cp is getting "PermissionDenied" from)

Re:Uutils: an attempt at writing cross-platform CLI utilitie... by masklinn on Monday December 06, 2021 @01:30AM (#29456832)
> I don't see the problem for something that was just released as a very preliminary version

Fwiw the project os half a decade old.

> (Though I don't know where cp is getting "PermissionDenied" from)

Have not looked at the problematic code but e.g. copy_file_range(2) says

> EPERM fd_out refers to an immutable file.

Re:Uutils: an attempt at writing cross-platform CLI utilitie... by db48x on Monday December 06, 2021 @01:33AM (#29456847)
While that is a good point, it is quite unsightly to panic from unwrapping. Instead it should propagate that error back to the top level where a nicer error message can be generated.
Re:Uutils: an attempt at writing cross-platform CLI utilitie... by megous on Monday December 06, 2021 @04:32AM (#29457805)
More importantly cp should continue copying other inputs even if one of the source files fails to be readable. Handling errors by panic doesn't suggest that will be the case.
Re:Uutils: an attempt at writing cross-platform CLI utilitie... by db48x on Tuesday December 07, 2021 @01:15AM (#29469534)
I don’t know if that is _more_ important, but I agree that it is also important :)

The reason I say this is that while users will expect this behavior, doing it well (so that it can be parallelized, for example) requires careful thinking about how errors should flow, how lines are printed to stdout, etc.