Page 1 of 1

Directory exist on LAN

Posted: Fri Jun 22, 2018 6:38 am
by Victorio
Hi,

Who know how determine if network (shared) folder exist ?

Function DC_ISDIR() not work for shared folders.

I tryed directory name as \\myserver\TESTFOLDER\ and also \\192.168.10.22\TESTFOLDER\
but no work.
Also not work Fexist(pomdir,"D")
where pomdir:="\\myserver\TESTFOLDER"

Now I can only try test to write some file to this folder, and test if file is created and delete them.
But for read only folder it is impossible.

Re: Directory exist on LAN

Posted: Fri Jun 22, 2018 6:58 am
by Tom

Code: Select all

? File(<cFolderNameWithPath>,"D")

Re: Directory exist on LAN

Posted: Fri Jun 22, 2018 7:25 am
by Victorio
Hi Tom,

file() with "D" parameter not work for me, at local ok, but for shared folder (folder is on PC with W10 and I work from W7) not work, return false.
To shared folder I can write, no problem, only test existence is problem.

Re: Directory exist on LAN

Posted: Fri Jun 22, 2018 9:14 am
by Wolfgang Ciriack
What is if you use

Code: Select all

function DirExits(d)
local aktlw:=CurDrive()+":"+dirname(), retw:=.F.

if dirchange(d)<>0
   ** d not exists
else
   retw:=.T.
endif
dirchange(aktlw)
return retw

Re: Directory exist on LAN

Posted: Fri Jun 22, 2018 10:37 am
by Victorio
With change directory by your function this works .
Ok, I can use this method.

Thank you for advice

Victorio