stevedlawrence commented on a change in pull request #44:
URL: https://github.com/apache/daffodil-vscode/pull/44#discussion_r736743182



##########
File path: 
server/core/src/main/scala/org.apache.daffodil.debugger.dap/Parse.scala
##########
@@ -211,9 +211,10 @@ object Parse {
                           Either
                             
.catchNonFatal(LaunchArgs.InfosetOutput.File(Paths.get(path.getAsString)))
                             .leftMap(t => s"'infosetOutput.path' field from 
launch request is not a valid path: $t")
-                            .ensureOr(file => s"can't write to infoset output 
file at ${file.path}")(
-                              _.path.toFile().canWrite()
-                            )
+                            .ensureOr(file => s"can't write to infoset output 
file at ${file.path}") { f =>
+                              val file = f.path.toFile
+                              file.exists && file.canWrite || 
file.getParentFile.canWrite

Review comment:
       What about the case "if the file exists but you can't write to it". 
Right now, that wouldn't cause an error if you can write to the parent 
directory. But then we'll eventually get an error when you try to actually 
open+write this file.
   
   I mentioned delete because in such a case, if you can write to the parent 
then you could theoretically delete the file and recreate it with open+write 
mode. But I'd suggest that the file existing but not writable should just 
always be an error. Which I think is what my suggestion does.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to