duc.c: Create ~/.cache if needed#296
Conversation
|
I'd merge this, but you need to handle errors better. If the mkdir() call fails, duc needs to error our more gracefully. I like the idea, but it needs some more work. And apologies for the delay, now that v1.5.0-rc1 is about to come out, it would be great if you could re-spin this to address these issues. |
|
Erm, 5da92b8 causes duc to fatally exit if the mkdir fails, which occurs if the directory already exists... |
|
Exactly! You need to check if the directory exists, or run mkdir() and check the return properly. I've already pushed a possible fix for this, but my brain is mush tonight and I still need to test stuff better. |
|
I raised PR #356 to fix this a couple of weeks ago. Edit: oh no I didn't, I only fixed the related issue of failing if |
|
>>>> "Jonathan" == Jonathan Dowland ***@***.***> writes:
#jmtd left a comment (zevv/duc#296)
I raised PR #356 to fix this a couple of weeks ago
And I looked at it and I had some comments on how it was done.
|
thanks! I missed wherever those comments are, because they aren’t on the PR. |
|
>>>> "Jonathan" == Jonathan Dowland ***@***.***> writes:
#jmtd left a comment (zevv/duc#296)
And I looked at it and I had some comments on how it was done.
thanks! I missed wherever those comments are, because they aren’t on the PR.
Yeah, I've been using both gitlab interface to comment, and email
list. Oops. Busy with community theatre lighting right now all week,
so more on duc over the weekend maybe.
|
|
I updated PR #356 to address this issue now (the solution in this PR will fail if |
|
This PR ignores the return value of Regardless, the return value of |
Good point. Sorry |
|
>>>> "Chongyun" == Chongyun Lee ***@***.***> writes:
#licy183 left a comment (zevv/duc#296)
This PR ignores the return value of mkdir. While mkdir ~/.cache will
indeed fail when ~/.cache exists, the program will still continue
execution.
Yes, this is a problem
Regardless, the return value of mkdir should be handled properly, so
I will close this PR and lean towards #356.
If you look at the latest HEAD I think I've already got this handled
properly. Can you confirm?
|
If
~/.cachedoesn't exist, some error will happen. See termux/termux-packages#11350 (comment).