equal
deleted
inserted
replaced
216 bash("cp -a " + File.bash_path(dir1) + " " + File.bash_path(dir2)).check |
216 bash("cp -a " + File.bash_path(dir1) + " " + File.bash_path(dir2)).check |
217 |
217 |
218 def copy_file(src: JFile, dst: JFile): Unit = |
218 def copy_file(src: JFile, dst: JFile): Unit = |
219 { |
219 { |
220 val target = if (dst.isDirectory) new JFile(dst, src.getName) else dst |
220 val target = if (dst.isDirectory) new JFile(dst, src.getName) else dst |
221 if (!eq(src, target)) { |
221 if (!File.eq(src, target)) { |
222 Files.copy(src.toPath, target.toPath, |
222 Files.copy(src.toPath, target.toPath, |
223 StandardCopyOption.COPY_ATTRIBUTES, |
223 StandardCopyOption.COPY_ATTRIBUTES, |
224 StandardCopyOption.REPLACE_EXISTING) |
224 StandardCopyOption.REPLACE_EXISTING) |
225 } |
225 } |
226 } |
226 } |
239 /* move */ |
239 /* move */ |
240 |
240 |
241 def move_file(src: JFile, dst: JFile) |
241 def move_file(src: JFile, dst: JFile) |
242 { |
242 { |
243 val target = if (dst.isDirectory) new JFile(dst, src.getName) else dst |
243 val target = if (dst.isDirectory) new JFile(dst, src.getName) else dst |
244 if (!eq(src, target)) |
244 if (!File.eq(src, target)) |
245 Files.move(src.toPath, target.toPath, StandardCopyOption.REPLACE_EXISTING) |
245 Files.move(src.toPath, target.toPath, StandardCopyOption.REPLACE_EXISTING) |
246 } |
246 } |
247 |
247 |
248 def move_file(path1: Path, path2: Path): Unit = move_file(path1.file, path2.file) |
248 def move_file(path1: Path, path2: Path): Unit = move_file(path1.file, path2.file) |
249 |
249 |