Directory exist on LAN

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Directory exist on LAN

#1 Post 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.

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Directory exist on LAN

#2 Post by Tom »

Code: Select all

? File(<cFolderNameWithPath>,"D")
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Directory exist on LAN

#3 Post 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.

Wolfgang Ciriack
Posts: 478
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Directory exist on LAN

#4 Post 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
_______________________
Best Regards
Wolfgang

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Directory exist on LAN

#5 Post by Victorio »

With change directory by your function this works .
Ok, I can use this method.

Thank you for advice

Victorio

Post Reply