slGetFile refers to working with a "... flat file (standard or INI) ...
What's the definition/layout of a standard "flat file" in this case
There is a good definition at http://en.wikipedia.org/wiki/Flat_file_database
I started calling them Binary files in release 1.4 because of the use of
PowerBasic binary file mode to Get$ and Put$ the contents of any file.
I think of data files as two types: databases and flat/binary. With
slGetFile and slPutFile you are able to manipulate(read/write) flat/binary
files anyway you want to. The files may reside on the local computer or on the server.
An Ini file is a flat/binary file with a specific format that slGetFile
and slPutFile support. A Csv file is a flat/binary file with a specific
format that also may be processed with slGetFile and slPutFile.
Read the doc about slGetFile and slPutFile in SQLitening.Txt or
SQLitening.Chm and then you may want to write a simple program that reads
and writes a flat/binary file.
With text files it is easy to just let another program handle the data rather than loading into a control.
I just used the filename already in the FACT which is nice for passing data back and forth.
FUNCTION GetFile AS LONG
LOCAL result AS LONG, sFileName, sData, rsModChars, NewFile AS STRING
sFileName = "RemoteFileUploadDownloadExample.txt"
result = slGetFile(sFileName,sData,rsModChars)
IF result THEN EXIT FUNCTION
NewFile = EXE.PATH$ + sFileName
result = FREEFILE
OPEN NewFile FOR OUTPUT AS #result
IF ERR THEN ? "error" + STR$(ERRCLEAR) + " opening for output " + NewFile:EXIT FUNCTION
PRINT #result, sData
IF ERR THEN ? "error" + STR$(ERRCLEAR) + " writing " + NewFile:CLOSE #result:EXIT FUNCTION
ShellExecute(ghDlg, "Open", NewFile + CHR$(0), $NUL, $NUL, %SW_SHOWNORMAL)
slGetFile also works in a threaded environment where each thread must issue a slConnect.
slDisconnect may be used after a thread finishes.
Any file to be transferred must have its name in the [FACT] section of ..\bin\SqliteningServer.cfg.
The physical file on the server must be in ..\bin or underneath on the server.