# HG changeset patch # User wenzelm # Date 1428831485 -7200 # Node ID 9a06e10f1a5ce019119caaaad78e51a493f4cf20 # Parent c42d65e11b6e8bd42c5b4a133572e4f3e4a3b91a avoid redundant shell process; diff -r c42d65e11b6e -r 9a06e10f1a5c src/Pure/System/isabelle_system.ML --- a/src/Pure/System/isabelle_system.ML Sun Apr 12 11:23:36 2015 +0200 +++ b/src/Pure/System/isabelle_system.ML Sun Apr 12 11:38:05 2015 +0200 @@ -59,9 +59,8 @@ (* directory operations *) fun mkdirs path = - if #rc (Bash.process ("mkdir -p " ^ File.shell_path path)) <> 0 then - error ("Failed to create directory: " ^ Path.print path) - else (); + if File.is_dir path orelse #rc (Bash.process ("mkdir -p " ^ File.shell_path path)) = 0 then () + else error ("Failed to create directory: " ^ Path.print path); fun mkdir path = if File.is_dir path then () else OS.FileSys.mkDir (File.platform_path path); diff -r c42d65e11b6e -r 9a06e10f1a5c src/Pure/System/isabelle_system.scala --- a/src/Pure/System/isabelle_system.scala Sun Apr 12 11:23:36 2015 +0200 +++ b/src/Pure/System/isabelle_system.scala Sun Apr 12 11:38:05 2015 +0200 @@ -257,8 +257,8 @@ /* mkdirs */ def mkdirs(path: Path): Unit = - if (bash("mkdir -p " + shell_path(path)).rc != 0) - error("Failed to create directory: " + quote(platform_path(path))) + if (path.is_dir || bash("mkdir -p " + shell_path(path)).rc == 0) () + else error("Failed to create directory: " + quote(platform_path(path)))