Welcome to the Monastery | |
PerlMonks |
Create text files recursively and write ZEROS within them all - data overwriting purposesby panicbuttonsec (Initiate) |
on Dec 29, 2015 at 19:58 UTC ( [id://1151402]=perlquestion: print w/replies, xml ) | Need Help?? |
panicbuttonsec has asked for the wisdom of the Perl Monks concerning the following question: I am new to both perl and this forum. Please forgive any possible etiquette issues as I do not intend to be rude. I'm also nowhere near solid with programming languages but am working toward that. My goal is to create a perl script that will write ZEROS to a text file until the file is around 2GB in size. I have the following code that works for a single file:
The thing is, I need it to then create a new textfile, append a 7-digit number to the name (to account for large storage volumes), and also fill that with zeros as with the first text file. I can do the math as needed for each drive/volume in order to know how many files will need to be created. I could use help with the perl code to create text files, then write to them until the amount of space has been overwritten by these next text files. My goal is to overwrite a hard drive after a client project completes in order to secure their privacy. Sure, I could do this via a linux command prompt, but I often have some idle/under-used Windows machines, so I was hoping to use perl to accomplish this. I rarely have an extra linux box available at present. Plus, if I can get this working via perl, then I should be able to utilize it on any Unix/Linux machines I get down the line, even if a few tweaks are needed. Plus, I want to learn Perl and find ways to use it to my advantage. I suspect that this will involve variables for the name creation (at least the incremental numbering). If I could tell it how many files to create (edit the script before running) that would work I think. Thanks in advance for any assistance you can provide.
Back to
Seekers of Perl Wisdom
|
|