Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set f [open "C:/John/myFile.txt" "a+"]
- seek $f 0
- set fp [tell $f]
- seek $f 0 end
- set end [tell $f]
- # Restore current file pointer
- seek $f $fp
- while { $fp < $end } {
- puts -nonewline $f " "
- incr fp
- }
- close $f
- chan truncate $f 0
- close [open $thefilename "w"]
- close [open $path w]
- set blank_file [open "C:/tmp/blank.txt" "w"]
- close $blank_file
- file rename -force "C:/tmp/blank.txt" "C:/John/myFile.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement