-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.io.File.canWrite() is not sufficient to test whether ".cpcache" dir can be created #120
Comments
I'm open to a PR which fixes this. Bonus points for a test. |
Not sure when I'd have a chance to write up a PR. Test in Linux is, of course, easy: As for code, I think you already have it:
Not sure if there are any corner cases, but this works for [*] Thanks so much for |
So there is a difference between |
Seems to be, based on some _lite_ testing on Windows 7 & Debian Linux. Not
sure they're supposed to be different, but that's a Java issue
…On Thu, Dec 21, 2023, 04:47 Michiel Borkent ***@***.***> wrote:
So there is a difference between canWrite and isWriteable, that is the
crux?
—
Reply to this email directly, view it on GitHub
<#120 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4V3RK7NBAP3IJG5DW3FATYKQARVAVCNFSM6AAAAABA5QWUNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRVHE2TONJVGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@jdjohnston Can you provide an example where |
As my original Issue description says, this might be specific to Winsows,
maybe even just older Windows. I used Windows Explorer to remove write &
dir creation privileges from the test dir. In that dir there is
consistently a difference. Sorry I can't provide a command-line sequence,
but I had to use the GUI to remove the privileges
…On Thu, Dec 21, 2023, 13:28 José Luis Lafuente ***@***.***> wrote:
@jdjohnston <https://github.com/jdjohnston> Can you provide an example
where canWrite and isWriteable return a different value? I can't
reproduce it.
—
Reply to this email directly, view it on GitHub
<#120 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4V3RIX6GLQJ47ORPTZ4RLYKR5WVAVCNFSM6AAAAABA5QWUNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWG43DCNBYG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I think I may have confused things earlier when I mentioned Debian Linux. I
used Linux to verify that isWritable would give the desired result, _not_
that it gave a different result from canWrite. As one would hope, for a
simple test at least, they give the same result on Linux.
So sorry for any confusion! :(
On Thu, Dec 21, 2023, 13:43 Jonathan D Johnston ***@***.***>
wrote:
… As my original Issue description says, this might be specific to Winsows,
maybe even just older Windows. I used Windows Explorer to remove write &
dir creation privileges from the test dir. In that dir there is
consistently a difference. Sorry I can't provide a command-line sequence,
but I had to use the GUI to remove the privileges
On Thu, Dec 21, 2023, 13:28 José Luis Lafuente ***@***.***>
wrote:
> @jdjohnston <https://github.com/jdjohnston> Can you provide an example
> where canWrite and isWriteable return a different value? I can't
> reproduce it.
>
> —
> Reply to this email directly, view it on GitHub
> <#120 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD4V3RIX6GLQJ47ORPTZ4RLYKR5WVAVCNFSM6AAAAABA5QWUNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWG43DCNBYG4>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Is the summary that we should switch to |
Sounds good to me!
…On Thu, Dec 21, 2023, 15:19 Michiel Borkent ***@***.***> wrote:
Is the summary that we should switch to java.nio isWritable and then we
can close the issue? Happy to do this.
—
Reply to this email directly, view it on GitHub
<#120 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4V3RLQXTJ327SPV3PZSHTYKSKWPAVCNFSM6AAAAABA5QWUNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWHA4DENBQGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
ok, pushed. you can perhaps test the Windows build artifact when CI finishes. I can make a new release tomorrow or so if that's necessary |
Just tried the build artifact on my R/O Win 7 dir. As hoped for, deps.clj
used the cache_dir since the cwd wasn't writable.
Is there another corner case? Couldn't say, but at least _this_ one is now
accounted for.
Thanks & Merry Christmas!
…On Thu, Dec 21, 2023, 15:29 Michiel Borkent ***@***.***> wrote:
ok, pushed. you can perhaps test the Windows build artifact when CI
finishes. I can make a new release tomorrow or so if that's necessary
—
Reply to this email directly, view it on GitHub
<#120 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4V3RP7KH4YRS3B62EETBLYKSLZFAVCNFSM6AAAAABA5QWUNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWHA4TCMRSGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
New release is available |
@borkdude The new release recognizes that the test dir is R/O, as desired. No obvious regression :) |
This is an issue on Windows 7. Can't say if it's true for newer Windows or other OSes.
I was looking for a test case to try verify that I was actually using
1.11.1.1429
by settingDEPS_CLJ_TOOLS_VERSION
as you suggested. One new item is the handling of.cpcache
if thecwd
isn't writable.deps.clj
usesjava.io.File.canWrite()
, but that doesn't always work, which is easy to demonstrate inbb
.I set
C:\Users\JDJ\tmp\xper
such that I didn't have write or dir creation privileges inxper
. I wasn't surprised that1.11.1.1413
had problems, but1.11.1.1429
was supposed to handle that case. However, I got the same error. After inspecting the Clojure code, I tried the following inbb
:Please ignore the typo (".cpache"). :)
The text was updated successfully, but these errors were encountered: