打开外部文件的几种 语法, openFile [ mode: ]

openFile <filename_string> [ mode:<mode_string> ] 语法   

 

语法默认是,rt - read-only text - file must exist 只读文件,文件必须存在。这个是关键点。

 

r - read-only text - file must exist 只读文件 文件必须存在。

rb - read-only binary - file must exist 只读二进制文件,文件必须存在。

r+ - read/write text - file must exist  读写文件 文件必须存在

a - write-only text, append writes - file must exist --只写文件 文件必须存在。

at - write-only text, append writes - file must exist 只写文件 文件必须存在

ab - write-only binary, append writes - file must exist 只写二进制文件 文件必须存在

a+ - read/write text, append writes - file must exist 读写文件 附上写 文件必须存在

w - write-only text - deletes file contents if it exists  只写文件删除文件内容 如果他存在

wt - write-only text - deletes file contents if it exists

wb - write-only binary - deletes file contents if it exists

w+ - read/write text - deletes file contents if it exists

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(String)