Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions acquire/outputs/dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class DirectoryOutput(Output):
def __init__(self, path: Path, **kwargs):
self.path = path
self.path = path.with_suffix(".running")

def write(
self,
Expand Down Expand Up @@ -50,4 +50,4 @@ def write(
shutil.copyfileobj(fh, fhout)

def close(self) -> None:
pass
self.path.rename(self.path.parent.joinpath(self.path.stem))
4 changes: 3 additions & 1 deletion acquire/outputs/tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(
ext += ".enc"

self._fh = None
self.path = path.with_suffix(path.suffix + ext)
self.path = path.with_suffix(path.suffix + ext + ".running")

if encrypt:
self._fh = EncryptedStream(self.path.open("wb"), public_key)
Expand Down Expand Up @@ -107,3 +107,5 @@ def close(self) -> None:
self.tar.close()
if self._fh:
self._fh.close()

self.path.rename(self.path.parent.joinpath(self.path.stem))
4 changes: 3 additions & 1 deletion acquire/outputs/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
ext += ".enc"

self._fh = None
self.path = path.with_suffix(path.suffix + ext)
self.path = path.with_suffix(path.suffix + ext + ".running")

if compress:
self.compression = ZIP_COMPRESSION_METHODS.get(compression_method, zipfile.ZIP_DEFLATED)
Expand Down Expand Up @@ -109,6 +109,8 @@ def close(self) -> None:
if self._fh:
self._fh.close()

self.path.rename(self.path.parent.joinpath(self.path.stem))

def _get_external_attr(self, entry: FilesystemEntry) -> int:
"""Return the appropriate external attributes of the entry."""

Expand Down