MCPcopy Index your code
hub / github.com/benfry/processing4 / copyDirNative

Method copyDirNative

app/src/processing/app/Util.java:348–367  ·  view source on GitHub ↗
(File sourceDir,
                                   File targetDir)

Source from the content-addressed store, hash-verified

346
347
348 static public void copyDirNative(File sourceDir,
349 File targetDir) throws IOException {
350 Process process;
351 if (Platform.isMacOS() || Platform.isLinux()) {
352 process = Runtime.getRuntime().exec(new String[] {
353 "cp", "-a", sourceDir.getAbsolutePath(), targetDir.getAbsolutePath()
354 });
355 } else {
356 // TODO implement version that uses XCOPY here on Windows
357 throw new RuntimeException("Not yet implemented on Windows");
358 }
359 try {
360 int result = process.waitFor();
361 if (result != 0) {
362 throw new IOException("Error while copying (result " + result + ")");
363 }
364 } catch (InterruptedException e) {
365 e.printStackTrace();
366 }
367 }
368
369
370 /**

Callers 1

exportApplicationMethod · 0.95

Calls 5

isMacOSMethod · 0.95
isLinuxMethod · 0.95
execMethod · 0.80
waitForMethod · 0.80
printStackTraceMethod · 0.45

Tested by

no test coverage detected