Skip to content

Conversation

makeittotop
Copy link
Contributor

Hi @harshavardhana Please let me know if this PR can be approved and merged?

Currently dperf fails silently if the directory at a given mount path is not writable. For example -

$ touch /tmp/foo1/.tmpFile
touch: cannot touch '/tmp/foo1/.tmpFile': Permission denied

$ dperf /tmp/foo1
┌───────────┬────────────┐
│ TotalREAD │ TotalWRITE │
│ 0 B/s     │ 0 B/s      │
└───────────┴────────────┘

$ echo $?
0

The cmd should instead return an error code and a meaningful error message to stderr as it does in case a directory at the mount path doesn't exists.

$ stat /tmp/foo
stat: cannot statx '/tmp/foo/': No such file or directory

$ dperf /tmp/foo         

$ echo $?
1

With the proposed changes -

$ dperf /tmp/foo1
ERROR directory at path '/tmp/foo1' is not writable

$ echo $?               
1

$ dperf /tmp/foo1 --verbose
ERROR directory at path '/tmp/foo1' is not writable

$ echo $?               
1

@harshavardhana
Copy link
Member

Hi @harshavardhana Please let me know if this PR can be approved and merged?

Currently dperf fails silently if the directory at a given mount path is not writable. For example -

$ touch /tmp/foo1/.tmpFile
touch: cannot touch '/tmp/foo1/.tmpFile': Permission denied

$ dperf /tmp/foo1
┌───────────┬────────────┐
│ TotalREAD │ TotalWRITE │
│ 0 B/s     │ 0 B/s      │
└───────────┴────────────┘

$ echo $?
0

The cmd should instead return an error code and a meaningful error message to stderr as it does in case a directory at the mount path doesn't exists.

$ stat /tmp/foo
stat: cannot statx '/tmp/foo/': No such file or directory

$ dperf /tmp/foo         

$ echo $?
1

With the proposed changes -

$ dperf /tmp/foo1
ERROR directory at path '/tmp/foo1' is not writable

$ echo $?               
1

$ dperf /tmp/foo1 --verbose
ERROR directory at path '/tmp/foo1' is not writable

$ echo $?               
1

This is not actually correct, what we need to show is the error per drive in the table.

@makeittotop
Copy link
Contributor Author

makeittotop commented Oct 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants