Method Stdio.File()->open()
- Method
open
intopen(stringfilename,stringmode)
intopen(stringfilename,stringmode,intmask)- Description
Open a file for read, write or append. The parameter
modeshould contain one or more of the following letters:"r"Open file for reading.
"w"Open file for writing.
"a"Open file for append (use with
"w")."t"Truncate file at open (use with
"w")."c"Create file if it doesn't exist (use with
"w")."x"Fail if file already exists (use with
"c").modeshould always contain at least one of the letters"r"or"w".The parameter
maskis protection bits to use if the file is created. Default is0666(read+write for all in octal notation).- Returns
This function returns
1for success,0otherwise.- See also