Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Getf Source Code
 previous   up   next 

Function Summary
string
getf (in string: file_name)
Read the file with the given 'file_name' into a string.
void
putf (in string: file_name, in string: stri)
Write the string 'stri' to the file with the name 'file_name'.
array string
readf (in string: file_name)
Read the file with the name 'file_name' into an array of strings.
void
writef (in string: file_name, in array string: data)
Write the string array 'data' to the file with the name 'file_name'.

Function Detail

getf

const func string: getf (in string: file_name)

Read the file with the given 'file_name' into a string.

Returns:
a string with the file content, or "" when no file exists.

putf

const proc: putf (in string: file_name, in string: stri)

Write the string 'stri' to the file with the name 'file_name'. If the file exists already, it is overwritten.


readf

const func array string: readf (in string: file_name)

Read the file with the name 'file_name' into an array of strings. The function accepts lines ending with LF or with CR LF. The line endings are not copied into the strings. The last line of the file needs not to be terminated with a LF.

Returns:
a string array with the file content, or an empty array when no file exists.

writef

const proc: writef (in string: file_name, in array string: data)

Write the string array 'data' to the file with the name 'file_name'. The elements of the array are written as lines to the file. The function uses LF as line ending and the last line is also terminated with a LF. If the file exists already, it is overwritten.



 previous   up   next