diff options
author | hut <hut@lavabit.com> | 2010-04-20 10:51:07 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-20 18:58:15 +0200 |
commit | 42cda6f82a8019cf477527ff4b44b22948ae65cf (patch) | |
tree | 58c0262d560fe3c95ce2b90cb4deae7d2c0929c9 | |
parent | d528952a414cde9d704f736339c1dcbe18abd2ae (diff) | |
download | ranger-42cda6f82a8019cf477527ff4b44b22948ae65cf.tar.gz |
core.actions: use `cp` for copying
-rw-r--r-- | ranger/core/actions.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 00e4782b..ef18a553 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -16,9 +16,11 @@ import os import re import shutil +import time from os.path import join, isdir from os import symlink, getcwd from inspect import cleandoc +from subprocess import Popen, PIPE import ranger from ranger.ext.direction import Direction @@ -591,18 +593,13 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): else: descr = "copying files from: " + one_file.dirname def generate(): - for f in self.env.copy: - if isdir(f.path): - for _ in shutil_g.copytree(src=f.path, - dst=join(self.env.cwd.path, f.basename), - symlinks=True, - overwrite=overwrite): - yield - else: - for _ in shutil_g.copy2(f.path, original_path, - symlinks=True, - overwrite=overwrite): - yield + process = Popen(['cp', '--backup=existing', '--archive', + '-t', self.env.cwd.path] + \ + [f.path for f in self.env.copy], + stdout=PIPE, stderr=PIPE) + while process.poll() is None: + yield + time.sleep(0.05) cwd = self.env.get_directory(original_path) cwd.load_content() |