|
||||||||||||||||
Home Products Download Tutorials
Web Ring/Links Contact |
Files functionsopen()This function opens a file. The first parameter contains the path to access the file. The second contains the open's mode, r to read or w to write, in the last case, the file will be completely replace. Remark: the \ (backslash) is a special character, it must be doubled in file name or use in place the / (slash).Examples :
close()This function closes a file opens previously by the open() function.Examples :see open(). readline() readlines()Those functions read a file opens by the open() function. The first one, read a file line by line. The second assigns in a list variable all lines in the fine.Examples :
write() writelines()Those functions write the variable's content in a file. The writelines() function writes into a file a list of lines, generally reads by the readlines() function, without add the carriage return at the end of line.Examples :
flush()This function forces the writing data still pending in I/O buffer. This function is implicitly calls by the close() function. Generally, this function is used to create a journal file that allows a program to restart at it last control point written.Example :
CreditAuthor and translation : Guy Demesmaeker© Sabam 2004 |
|
||||||||||||||
|