sa_arvind
26th December 2008, 06:52
Hi All,

I want to check the client windows directory is valid and it has the write permission or not. User inputs the path of the directory on the form and so i have to validate whether if the path is valid and it has the write permission or not. please check the codes below:

field.repert:
check.input:
if strip$(shiftl$(repert)) = "" then
message("Path cannot be empty")
set.input.error("")
else
ret = create.local.directory(strip$(shiftl$(repert))&"\tmp")
if ret = 0 then
remove.local.directory(strip$(shiftl$(repert))&"\tmp")
else
if ret = 5 then
message("No Permission to write")
set.input.error("")
else
if ret <> 183 then
message("Not a valid Path")
set.input.error("")
endif
endif
endif
endif

Note:
repert is the form field where the user enters the path.


Thanks in advance.

sa_arvind

_Ralph_
26th December 2008, 14:02
In LN I use the following function:


tgbrg0028.create.client.directory(string client.dir, boolean create.directory)



The first argument specify the directory on the client, and the second in case there are no directory a message asking if the user want to create is displayed.

NPRao
26th December 2008, 19:42
Arvind,

Use the search option on the forum to refer to the already discussed threads -

Check client directory (http://www.baanboard.com/baanboard/showthread.php?t=7127)

Check and access directory on remote system (http://www.baanboard.com/baanboard/showthread.php?t=12310)

seq.fstat.local() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_client_file_access_seq_fstat_local)

sa_arvind
31st December 2008, 10:53
thank You all for quick response.
I am checking the links referred by you.