Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --The program still does not work.
- --Made by Dimon6,
- --input[1] will be the path.
- local input = { ... }
- ---------------------------------------
- --This part checks if the parameter passed is a string
- function isValidPath(path)
- if fs.exists(path) == true and fs.isDir(path) == false and fs.isReadOnly(path) == false then
- return true
- else
- return false
- end
- end
- --End of function isValidPath()
- ------------------------
- if #input > 1 or #input == 0 then
- print("Invalid number arguments.You must enter only the path of the file you with to wipe.");
- elseif #input == 1 and isValidPath(input[1]) == true then
- local size = fs.getSize(input[1]);
- --Set to 4 passes.
- for k=1,4,1 do
- local file = fs.open(input[1], "wb");
- --The file will always be overwritten with
- --same size.
- for i=1,size,1 do
- local num = math.random();
- file.write(math.random(0x00,0xFF));
- sleep(0.1);
- end
- file.close();
- end
- fs.delete(input[1]);
- print("Finished");
- elseif isValidPath(input[1]) == false then
- print("The path is not valid or it might be read only.");
- end
- --End of program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement