Please sign in to comment.
core.actions: imported shutil_g paste function from v1.2.3
The code implements the functionality of cp and mv coreutils in python and was removed as of v1.4.0 for efficiency and simplicity reasons. I moved it back in for several reasons: 1. I plan to enhance shutil_g to report on its copying status so I can display a progress bar 2. With no need for external cp/mv programs, distribution-specific differences (like broken backup option on MacOS/BSD?) become irrelevant 3. You can still copy in ranger if you accidently delete /bin/cp 4. It gets rid of the occasional bug that the cp process keeps running when ranger is terminated while copying The possible downside is reduced efficiency in copying and ranger might get stuck if the copying function is blocked. Let's see if it works out.
- Loading branch information...
Showing with 364 additions and 34 deletions.
|@@ -0,0 +1,26 @@|
|+# Copyright (C) 2012 Roman Zimbelmann <firstname.lastname@example.org>|
|+# This software is distributed under the terms of the GNU GPL version 3.|
|+def Popen_forked(*args, **kwargs):|
|+ Forks process and runs Popen with the given args and kwargs.|
|+ If os.fork() is not supported, runs Popen without forking and returns the|
|+ process object returned by Popen.|
|+ Otherwise, returns None.|
|+ pid = os.fork()|
|+ # fall back to not forking if os.fork() is not supported|
|+ return subprocess.Popen(*args, **kwargs)|
|+ if pid == 0:|
|+ kwargs['stdin'] = open(os.devnull, 'r')|
|+ kwargs['stdout'] = kwargs['stderr'] = open(os.devnull, 'w')|
|+ subprocess.Popen(*args, **kwargs)|
Oops, something went wrong.