[Procedure]
- Open file --> Read/Write file --> Close file
[Syntax]
- Open ==> open filename "access"
- Write ==> puts filename "content"
- Close ==> close filename
- set fd [open "$PATH/$var_sn.tmp.log" a]
- puts $fd "[time_str]: $msg"
- close $fd
[Access Parameter List]
- r : Reading a existing file
- r+ : Reading & Writing a existing file
- w : Empty a existing file, and Writing the content.
- w: Establish a new file, and Writing the content.
- w+ : Empty a existing file, and Writing & Reading the content.
- w+ : Establish a new file, and Writing & Reading the content.
- a : Append the content into the end of existing file, or Establish a new one.
- a+ : Append (Read & Write) the content into the end of existing file, or Establish a new one.
沒有留言:
張貼留言