diff options
| author | jvoisin | 2014-06-21 16:40:29 +0200 |
|---|---|---|
| committer | jvoisin | 2014-06-21 16:40:29 +0200 |
| commit | 460aa0c3a87f8efeb6078304f8530e440d9add85 (patch) | |
| tree | 8300b69edfa37b9303cd2eedd22b6c344edd50b3 /libmat | |
| parent | 310cf95b9e93aacaf38e63868cc08593794bd7e7 (diff) | |
Fix a portability issue on MacOS
shred is called gshred on MacOS
Diffstat (limited to 'libmat')
| -rw-r--r-- | libmat/mat.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libmat/mat.py b/libmat/mat.py index 8dfc2dc..70e9d75 100644 --- a/libmat/mat.py +++ b/libmat/mat.py | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | import logging | 6 | import logging |
| 7 | import mimetypes | 7 | import mimetypes |
| 8 | import os | 8 | import os |
| 9 | import platform | ||
| 9 | import subprocess | 10 | import subprocess |
| 10 | import xml.sax | 11 | import xml.sax |
| 11 | 12 | ||
| @@ -120,7 +121,10 @@ def secure_remove(filename): | |||
| 120 | raise libmat.exceptions.UnableToWriteFile | 121 | raise libmat.exceptions.UnableToWriteFile |
| 121 | 122 | ||
| 122 | try: | 123 | try: |
| 123 | if not subprocess.call(['shred', '--remove', filename]): | 124 | shred = 'shred' |
| 125 | if platform.system() == 'MacOS': | ||
| 126 | shred = 'gshred' | ||
| 127 | if not subprocess.call([shred, '--remove', filename]): | ||
| 124 | return True | 128 | return True |
| 125 | else: | 129 | else: |
| 126 | raise OSError | 130 | raise OSError |
