mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 09:08:38 +00:00
skin_streams: ask report_paths for the report-path guard
This commit is contained in:
committed by
Jan Trencansky
parent
301bec535c
commit
a8dd0cc33c
@ -45,6 +45,11 @@ import sys
|
||||
import time
|
||||
import zlib
|
||||
|
||||
ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
if ROOT not in sys.path:
|
||||
sys.path.insert(0, ROOT)
|
||||
from report_paths import same_report_path # noqa: E402
|
||||
|
||||
PAGE = 4096
|
||||
MAX_SYS = 32 * 1024 * 1024
|
||||
MAX_GFX = 224 * 1024 * 1024
|
||||
@ -450,14 +455,7 @@ def scan_archive(path, sample, log):
|
||||
return stats
|
||||
|
||||
|
||||
def same_output_path(first, second):
|
||||
"""True when writing ``second`` would truncate ``first`` (same file, path or hard link)."""
|
||||
if os.path.normcase(os.path.realpath(first)) == os.path.normcase(os.path.realpath(second)):
|
||||
return True
|
||||
try:
|
||||
return os.path.samefile(first, second)
|
||||
except OSError:
|
||||
return False
|
||||
same_output_path = same_report_path # True when writing the second would truncate the first
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
|
||||
Reference in New Issue
Block a user