mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-10 03:37:39 +02:00
Allow pickling of FileLayers by unsetting the file (it'll be reopened as soon as a read happens).
This commit is contained in:
@@ -130,6 +130,14 @@ class FileLayer(interfaces.layers.DataLayerInterface):
|
||||
self._file.seek(offset)
|
||||
self._file.write(data)
|
||||
|
||||
def __getstate__(self):
|
||||
"""Do not store the open _file_ attribute, our property will ensure the file is open when needed
|
||||
|
||||
This is necessary for multi-processing
|
||||
"""
|
||||
self._file_ = None
|
||||
return self.__dict__
|
||||
|
||||
def destroy(self):
|
||||
"""Closes the file handle"""
|
||||
self._file.close()
|
||||
|
||||
Reference in New Issue
Block a user