src/Pure/General/file.scala
changeset 78298 3b0f8f1010f2
parent 78243 0e221a8128e4
child 78952 4e1dc465dfcc
equal deleted inserted replaced
78297:ba3729a9d29d 78298:3b0f8f1010f2
   386   def is_executable(path: Path): Boolean = {
   386   def is_executable(path: Path): Boolean = {
   387     if (Platform.is_windows) Isabelle_System.bash("test -x " + bash_path(path)).check.ok
   387     if (Platform.is_windows) Isabelle_System.bash("test -x " + bash_path(path)).check.ok
   388     else path.file.canExecute
   388     else path.file.canExecute
   389   }
   389   }
   390 
   390 
   391   def set_executable(path: Path, flag: Boolean = false): Unit = {
   391   def set_executable(path: Path, reset: Boolean = false): Unit = {
   392     if (Platform.is_windows && flag) Isabelle_System.chmod("a+x", path)
   392     if (Platform.is_windows) Isabelle_System.chmod(if (reset) "a-x" else "a+x", path)
   393     else if (Platform.is_windows) Isabelle_System.chmod("a-x", path)
   393     else path.file.setExecutable(!reset, false)
   394     else path.file.setExecutable(flag, false)
       
   395   }
   394   }
   396 
   395 
   397 
   396 
   398   /* content */
   397   /* content */
   399 
   398