lbry-sdk icon indicating copy to clipboard operation
lbry-sdk copied to clipboard

Ensure that default download directory is writable on daemon startup

Open lyoshenka opened this issue 3 years ago • 10 comments

Creating a new issue based on lbryio/lbry-sdk#877

  • Update ensure_directory_exists() to check that the directory is writable by the current process.
  • If it's not, return a useful error
  • Add tests to cover the case when
    • download directory does not exist
    • download dir exists but is not writable
    • dir exists and is writable
    • the path refers to a file not a directory

bonus: also check if disk is full when sdk starts. this check should be outside ensure_directory_exists(). it probably goes somewhere near here

lyoshenka avatar Apr 20 '21 19:04 lyoshenka

"Good first issue" is what I'm looking for! I'll write the code tomorrow.

snapperVibes avatar Apr 21 '21 05:04 snapperVibes

PR for this https://github.com/lbryio/lbry-sdk/pull/3276 @snapperVibes sorry, didn't mean to try to snipe you, didn't see your comment until after I finished this!

jeffreypicard avatar Apr 23 '21 04:04 jeffreypicard

Your code is cleaner anyways.

snapperVibes avatar Apr 23 '21 04:04 snapperVibes

Hi @snapperVibes is this issue open ?

Rishabhraghwendra18 avatar Jul 07 '21 14:07 Rishabhraghwendra18

It's closed

snapperVibes avatar Jul 07 '21 14:07 snapperVibes

@lyoshenka Is this issue open or closed?

RyanRussell00 avatar Aug 04 '21 06:08 RyanRussell00

This issue is open.

tzarebczan avatar Aug 06 '21 13:08 tzarebczan

The pull request #3457, updating the ensure_directory_exists(), is available for a review.

ghost avatar Oct 20 '21 14:10 ghost

How impactful is the problem of the absence of the storage capacity fullness check on the start up? What would be a suitable methodology to verify the full storage capacity scenario? Would there be a merit in adding a check to see if the storage will potentially become full after a download? How impactful would the programming effort be?

ghost avatar Oct 23 '21 15:10 ghost

The ensure_directory_exists() now checks the directory is writable by the process.

ghost avatar Oct 27 '21 19:10 ghost