-
Notifications
You must be signed in to change notification settings - Fork 118
Conversation
@@ -95,5 +97,33 @@ public static class IOExtensions { | |||
} | |||
return Path.DirectorySeparatorChar.ToString(); | |||
} | |||
|
|||
public static bool HasWritePermission(this string path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the write permission was the problem for that bug. In that case, it was a directory belonging to a different user, so it couldn't even be read.
FWIW, perhaps it's easier to just try to do Directory.GetFiles
on it, and catch an exception? If it fails, then it's definitely not usable. I'm not sure it being not writeable would actually cause R to fail though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I wanted stricter check since writing generally assumes reading (in common sense case anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that is the case for Windows ACLs, at least - I just tried, and you can deny read and allow write to the same user at the same time, and it actually enforces it in that manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is possible in general case since ACLs may apply to, say, pipes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave writing check method for now in case we need it
#2843 Failure to set
AfterHostStarted
working directory stops RHost#2806 Still occasionally get package load failures
#2853 Error adding database connection
Update System.Collections.Immutable to 1.3.0