Handbook
Glossary
overwrite-with-random-bytes ( file-name -- )
Vocabulary
wipe
Inputs
file-name
a filename string
Outputs
None
Word description
Overwrite the
file-name
contents with random data. The slack space at the end is not overwritten.
Definition
USING:
accessors
io
io.encodings.binary
io.files
io.files.info
io.streams.random
kernel
namespaces
;
IN:
wipe
:
overwrite-with-random-bytes
( file-name -- )
[
remove-read-only
]
[
file-info
size>>
]
[
]
tri
binary
[
<limited-random-stream>
0
seek-absolute
output-stream
get
[
stream-seek
]
keep
stream-copy
]
with-file-appender
;