Nushell: Command 'du' on macOS throws error: "Operation not permitted (os error 1)"

Created on 29 Jan 2020  路  3Comments  路  Source: nushell/nushell

Describe the bug
So I wanted to run the new du command, and then this happened 馃槄

Screenshot 2020-01-29 at 21 10 53

I assume it caused by the new security features introduced with Catalina, i.e. https://www.howtogeek.com/443611/how-macos-catalinas-new-security-features-work/

System
I'm running

  • macOS Catalina 10.15.2 (19C57)
  • nu 0.9.0
bug polish

Most helpful comment

Ah, you're right! Running ^du I get errors like:

du: ./Library/Application Support/CallHistoryTransactions: Operation not permitted

du works fine in 'regular' directories.

I'd consider it an enhancement then to limit the impact of these errors and still list all other directories.

All 3 comments

Works for me.

Did you run this in a directory where there was a subdirectory/file that your account didn't have the privileges to stat? I'm guessing that's the problem, which is still a bug, just interested if that's the problem. You can try running ^du -d1 to see if it has the same issue (although it may complete, but may output errors to stderr).

Ah, you're right! Running ^du I get errors like:

du: ./Library/Application Support/CallHistoryTransactions: Operation not permitted

du works fine in 'regular' directories.

I'd consider it an enhancement then to limit the impact of these errors and still list all other directories.

Yeah, I think there's a more general enhancement here, or at least something to think about: when an output stream emits an error, should we fail immediately, or ignore? I think the latter shouldn't be done automatically, but perhaps a user could request it.

[EDIT]
To back up why I think the above w.r.t. an example. If we ignored errors in du's output stream, we'd be providing incomplete information, and users may not realize that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KasMA1990 picture KasMA1990  路  4Comments

triclops200 picture triclops200  路  4Comments

Matalus picture Matalus  路  4Comments

ProgrammingLife picture ProgrammingLife  路  3Comments

jonathandturner picture jonathandturner  路  3Comments