MCPcopy Index your code
hub / github.com/processing/processing / copyDirNative

Method copyDirNative

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

Source from the content-addressed store, hash-verified

259
260
261 static public void copyDirNative(File sourceDir,
262 File targetDir) throws IOException {
263 Process process = null;
264 if (Platform.isMacOS() || Platform.isLinux()) {
265 process = Runtime.getRuntime().exec(new String[] {
266 "cp", "-a", sourceDir.getAbsolutePath(), targetDir.getAbsolutePath()
267 });
268 } else {
269 // TODO implement version that uses XCOPY here on Windows
270 throw new RuntimeException("Not yet implemented on Windows");
271 }
272 try {
273 int result = process.waitFor();
274 if (result != 0) {
275 throw new IOException("Error while copying (result " + result + ")");
276 }
277 } catch (InterruptedException e) {
278 e.printStackTrace();
279 }
280 }
281
282
283// /**

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