LISDIR() and Windows 2000 Server Servoce Pack 3

LISDIR() and Windows 2000 Server Servoce Pack 3

Postby Boris » Sat Nov 17, 2007 2:03 am

Hi all,

I have problem with OS Windows 2000 Server Service pack3
The function LISDIR() works perfect on any other OS, than this one.

Anyone has this experience?
IS there any help?

Regards
User avatar
Boris
 
Posts: 16
Joined: Sun Nov 27, 2005 1:57 am

Postby James Bott » Sat Nov 17, 2007 3:05 am

Hi Boris,

I don't know about your specific problem, but I had this code in my notes file for Win98. Perhaps it will work for you.

James

Code: Select all  Expand view  RUN
-----------------------
// Replacement for FW's lisDir() which can't handle Win 98 network
// paths like \\compaq\c\faxserve
function lisDir(cPath)
   local nHandle,lSuccess:=.f.
   cPath:=lfn2sfn(alltrim(cPath))
   cPath:=if(right(cPath,1)="\",left(cPath,len(cPath)-1),cPath)
   if file(cPath+"\testfile.$$$")
      lSuccess:=.T.
   elseif ( nHandle := fcreate( cPath + "\testfile.$$$" )) > 0
      fclose(nHandle)
      ferase(cPath + "\testfile.$$$")
      lSuccess := .T.
   endif
return lSuccess
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby nageswaragunupudi » Sat Nov 17, 2007 6:22 am

you may try this code also:

Code: Select all  Expand view  RUN
function direxists( cpath )

local adir

return ( len( adir := directory( cpath, 'D' ) ) > 0 .and. adir[1][5] == 'D' )


This works with directories where the user does not have write permissions also. This works even without removing the trailing slash, if any. Hope it works on all versions of windows.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares and 85 guests