Handbook
Glossary
wipe-free-space ( path -- )
Wipe
Prev:
wipe-file ( file-name -- )
Vocabulary
wipe
Inputs
path
a pathname string
Outputs
None
Word description
Create a temporary file at
path
that consumes all of free space on the drive, fill it with random data, then delete the file. This has the effect of wiping any recoverable data left on the drive after insecurely deleting the files.
Definition
USING:
accessors
io
io.encodings.binary
io.files
io.files.info
io.files.unique
io.streams.random
kernel
namespaces
;
IN:
wipe
:
wipe-free-space
( path -- )
dup
[
file-system-info
free-space>>
""
""
unique-file
binary
[
<limited-random-stream>
output-stream
get
stream-copy
]
with-file-writer
]
with-temp-directory-at
;