Arlina
15th October 2019, 06:53
Hi All,
Is there any way to know if the local path specified in server2client(server.path, local.path, true) exists in the machine and the user has write permissions in the folder?
Thanks & Regards,
Arlina
oirfeodent
15th October 2019, 10:33
Hi All,
Is there any way to know if the local path specified in server2client(server.path, local.path, true) exists in the machine and the user has write permissions in the folder?
Thanks & Regards,
Arlina
Try using function long seq.fstat.local (string filename, ref long nr.bytes)
Regards,
Arlina
16th October 2019, 07:08
Thanks, but seq.fstat.local() returns file size.
I am moving a file to the local machine and what I want to know is whether the particular folder exists on the local machine and if it does, then does the user has write permissions to move the file in the folder.
v_kewl
25th October 2019, 01:22
You can create a batch file and place it at client machine or use server2client at run time move.
Call the batch file through baan script and read the output generated by it.
Run Batch commands to check Directory exists or not and Try creating a test file, and put the output of both actions in a file. Read the output file to determine both conditions.
Regards
NPRao
25th October 2019, 02:59
You can use the Standard function -
create.local.file()
Syntax:
#include <bic_desktop>
function long create.local.file (string filename)
Description
Deprecated. This creates a specified file on a client system. You must have write permission in the parent directory to do this. Access permissions for the new file are set to read and write, for all users. When the file does already exist, it will be truncated.
Arguments
string filename The full path name of the file. For example: create.local.file("C:\Program Files\mydir\myfile") The filename 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 WebUI.
Return values
0 Success.
<>0 Error. Probably no permission.
Context
This function is implemented in the 4GL Engine and can be used in all script types.
This function is marked as 'untrusted' and can therefore only be used in trusted objects. More about trusted and not trusted objects can be found in the section about managed execution..
Notes
This function is not supported in LN UI. See the Implementing LN UI support for more information.
oirfeodent
25th October 2019, 09:59
Thanks, but seq.fstat.local() returns file size.
I am moving a file to the local machine and what I want to know is whether the particular folder exists on the local machine and if it does, then does the user has write permissions to move the file in the folder.
seq.fstat.local() is going to tell you if the file is present or not...
There is no option which I am aware of to find if the folder has write permission.
Just download it and see what the return error code to user.
Cant see other option programatically.
Regards,
tmannais
25th October 2019, 10:27
Hi All,
Is there any way to know if the local path specified in server2client(server.path, local.path, true) exists in the machine and the user has write permissions in the folder?
Thanks & Regards,
Arlina
You can try to create a dummy file into the destination folder.
If the file can be created then you are good to go, else there is some error whether the folder does not exist or permission denied.