mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
sfx: avoid name collisions across reboots
This commit is contained in:
parent
c2b66bbe73
commit
f2cd0b0c4a
|
@ -224,11 +224,15 @@ def unpack():
|
|||
"""unpacks the tar yielded by `data`"""
|
||||
name = "pe-copyparty"
|
||||
tag = "v" + str(STAMP)
|
||||
withpid = "{}.{}".format(name, os.getpid())
|
||||
top = tempfile.gettempdir()
|
||||
opj = os.path.join
|
||||
final = opj(top, name)
|
||||
for suf in range(0, 9001):
|
||||
withpid = "{}.{}.{}".format(name, os.getpid(), suf)
|
||||
mine = opj(top, withpid)
|
||||
if not os.path.exists(mine):
|
||||
break
|
||||
|
||||
tar = opj(mine, "tar")
|
||||
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue