wwUtils::File2Var

Retrieves a file from disk into a string, and stores a string to a file. Dual function method handles both reading and writing of strings to and from files.

Unlike STRTOFILE and FILETOSTR in the VFP language, File2Var is multi-user safe and provides for retries if a file is locked.

o.File2Var(tcFileName, tcString, tlSharedWriteMode)

Return Value

String when reading from file or "" if an error occurs. .T. or .F. when writing a string to file.

Parameters

tcFileName
File name to retrieve when reading to string. File name to save to when saving to file.

tcString
String to write to file when writing to file.

tlSharedWriteMode
Only applies to writing - when .T. the file is written in shared write mode which means if the file is open in another application in shared mode the file will get written anyway. Be careful with this mode flag as it can easily cause confusion between two applications.

tlWriteUtf8
Encodes the file written to UTF8. No BOM written.


See also:

Library wwUtils

© West Wind Technologies, 1996-2018 • Updated: 01/14/16
Comment or report problem with topic