teddybear
24th June 2009, 10:11
Hi there,

Is there a function in Baan that can check the existance of a file in a network directory (not at local client)?

Currently, I am using the client2server function. If the transfer is successfully, the file exist at the network directory and vice versa.

This function work fine for me except when the file is being open at the time of client2server execution. When the file is opened, the transfer failed.

Thanks in advance.

zardoz
24th June 2009, 12:44
You can use:

seq.fstat.local()
Syntax:

function long seq.fstat.local (string filename, ref long nr.bytes)

Description


This retrieves information about a specified file on a client system.


Arguments

string filename The path argument must include the The full path to the file, including the drive name. This parameter may include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of Webtop.

ref long nr.bytes This returns the size of the file in bytes.


Return values

>=0 Success.
<0 Error. Probably file does not exist.

Context

This function can be used in all script types.

Example

seq.fstat.local("C:\Program Files\Test.txt", len.in.bytes)

teddybear
26th June 2009, 04:11
Hi zardoz,

Many thanks