prevent creation of Zombie processes when running lsof
This commit is contained in:
parent
671c627607
commit
57183b8ac8
1 changed files with 3 additions and 2 deletions
|
@ -166,8 +166,9 @@ def walk_supported(directory, clean_empties=False):
|
|||
|
||||
|
||||
def file_locked(path):
|
||||
f = Popen(["lsof", path], stdout=PIPE).stdout
|
||||
return bool(f.readlines())
|
||||
proc = Popen(["lsof", path], stdout=PIPE)
|
||||
out = proc.communicate()[0].strip('\r\n')
|
||||
return bool(out)
|
||||
|
||||
def magic_move(old, new, after_dir_make=lambda : None):
|
||||
""" Moves path old to new and constructs the necessary to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue