The NexusDB Remote File Stream package includes components to allow a client
application to open and work with files via a Nexus Server. In the
client application, the RemoteFileStream component works just like any other
TStream descendent. The client side plugin component also has some misc
functions to check if a file exists, delete, rename, or copy files.
The reason this component was created was to allow clients, communicating
to a server via a Transport, to access files on that remote computer without
requiring the client log-on to that computer.
Bug reports, comments, and suggestions for improvements are welcome and send
to NexusDB.public.support.thirdparty
How to use it.
1. Create a package that consists of all the RFS units
2. Compile and install the RFSPlugin package
3. Open the NxServer project, and open the dmServer form. On this
form add a RFSPluginCmdHandler and a ServerRFSPlugin. On the
RFSPluginCmdHandler, set the CommandHandler, EventLog, and PluginEngine
properties. Using the object inspector, there is only one choice for each.
On the ServerRFSPlugin set the EventLog property. Add the nxuiRFSSettings
unit to the server. Recompile and the server is ready to go.
4. In your new client application setup Transport and SimpleSession components.
Then add a RFSPlugIn and set the Session property to an existing Session component.
Now you are done with the IDE, the rest is Delphi code.
5. Here is an example of creating a file and copying from a normal
TFileStream to a remote file stream
OutStream := TpsnxRemoteFileStream.CreateEx( psnxRFSPlugIn1,'c:\TestOut2.zip', fmCreate ); try FileStream := TFileStream.Create( 'c:\test.zip', fmOpenRead ); try OutStream.CopyFrom( FileStream, 0 ); finally FileStream.Free; end; finally OutStream.Free; end;
Another example to open a remote file and copy it to a local drive.
RFStream := TpsnxRemoteFileStream.CreateEx( psnxRFSPlugIn1,'c:\TestOut2.zip', fmOpenRead ); try FileStream := TFileStream.Create( 'c:\test.zip', fmCreate ); try FileStream.CopyFrom( RFStream, 0 ); finally FileStream.Free; end; finally RFStream.Free; end;
The RFSPlugin also supports some misc. file management routines. See the source and example applications for a list and examples on how to use them.
Attachment | Size |
---|---|
RFS PlugIn.zip | 21.68 KB |