Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. set f [open "C:/John/myFile.txt" "a+"]
  2.  
  3. seek $f 0
  4. set fp [tell $f]
  5.  
  6. seek $f 0 end
  7. set end [tell $f]
  8.  
  9. # Restore current file pointer
  10. seek $f $fp
  11.  
  12. while { $fp < $end } {
  13. puts -nonewline $f " "
  14. incr fp
  15. }
  16.  
  17. close $f
  18.  
  19. chan truncate $f 0
  20.  
  21. close [open $thefilename "w"]
  22.  
  23. close [open $path w]
  24.  
  25. set blank_file [open "C:/tmp/blank.txt" "w"]
  26. close $blank_file
  27.  
  28. file rename -force "C:/tmp/blank.txt" "C:/John/myFile.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement