Ola!
Mais uma ferramenta para nós.
Desenvolvida pelo Russo Alexander Kresin, pai da Hwgui e um dos principais criadores do harbour.
Saudações
Itamar M. Lins Jr.
--------------------8<--------------------------------
Leto DB Server is a multiplatform database server or a database
management system, chiefly intended for client programs, written on Harbour,
be able to work with dbf/cdx files, located on a remote server.
1. Directory structure
bin/ - server executable file
doc/ - documentation
include/ - source header files
lib/ - rdd library
source/
client/ - rdd sources
common/ - some common source files
client/ - server sources
utils/
manage/ - server management utilities
2. Building binaries
2.1. Borland Win32 C compiler
An environment variable HB_PATH, which defines a path to the Harbour
directory, must be set before compiling. This can be done, for example,
by adding a line in a make_b32.bat:
SET HB_PATH = c:\harbour
If you use xHarbour, uncomment a line 'XHARBOUR = yes' in makefile.bc.
Then run the make_b32.bat and you will get server executable file letodb.exe in a bin/
directory and rdd library rddleto.lib in a lib/ directory.
2.2. Linux GNU C compiler
An environment variable HB_ROOT, which defines a path to the Harbour
directory, must be set before compiling. Or just change the value of HRB_DIR
in the Makefile.linux.
Then run the make_linux.sh and you will get server executable file letodb in a bin/
directory and rdd library librddleto.a in a lib/ directory.
3. Running and stopping server
Just run it:
letodb.exe ( under Windows )
./letodb ( under Linux )
To shutdown the server, run the same executable with a 'stop' parameter:
letodb.exe stop ( under Windows )
./letodb stop ( under Linux )
4. Server configuration
You may provide configuration file letodb.ini if you isn't satisfied with
default parameters values. Currently following parameters exists ( default
values are designated ):
Port = 2812 - server port number
DataPath = - path to a data directory on a server
Logfile = "letodb.log" - path and name of a log file
In Windows environment the letodb.ini must be placed in a directory, from
where server is started.
In Linux the program looks for it in the directory from where the server
is started and, if unsuccessfully, in the /etc directory.
5. Connecting to the server from client programs.
To be able to connect to the server you need to link the rddleto.lib (Windows)
or librddleto.a (Linux) to your aplication and add at start of a main source file
two lines:
REQUEST LETO
RDDSETDEFAULT( "LETO" )
To open a dbf file on a server, you need to write in a SET PATH TO
statement or in the USE command directly a path to the server in a standard
form //ip_address:port/data_path/file_name.
If a 'DataPath' parameter of a server configuration file is set to a non
empty value, you need to designate not the full path to a file on the server,
but only a relative ( relatively the 'DataPath' ).
For example, if the you need to open a file test.dbf, which is located on
a server 192.168.5.22 in a directory /data/mydir and the 'DataPath' parameter
value ( of a letodb.ini server configuration file ) is '/data', the syntax
will be the following:
USE "//192.168.5.22:2812/mydir/test"
6. Management utility.
There are two management utilities, GUI and console, the sources are in
utils/manage directory.
GUI utility, manage.prg, is made with the HwGUI library. If you have HwGUI,
just write in the line 'set HWGUI_INSTALL=' in utils/manage/bld.bat a path
to your HwGUI directory and run the bld.bat, it will build manage.exe for you.
For those, who doesn't use HwGUI, there is a console mode utility,
console.prg. Build a console.exe with a make/bat files, which you use to build
Harbour single-file programs, you just need to add rddleto.lib to the libraries
list. Run the console.exe with a server name or ip and port as a parameter:
console.exe server_name:nPort
console.exe ip_address:nPort
The server_name and ip_address in a command line must be without leading
slashes ( '//' ), because Clipper/Harbour interprets them in a special way.