Directory()

Directory()

Postby Otto » Mon Sep 05, 2011 6:00 pm

Hello Antonio,

may I ask your help with FWPPC

To check if I have access to the server I use
1. ping()
2. then I read the file attributes date/time of a file on the network.

Now I logged the steps and found out that if there is a problem with
Directory() it takes 30 sec. till a timeout comes and during this time the
IPAQ is frozen.

5.09.2011 15:41:31: hReturn
05.09.2011 15:41:32: else von ping
05.09.2011 15:41:32: directory ok
05.09.2011 15:41:32: hReturn
05.09.2011 15:49:23: else von ping

aInfo := Directory( cNETZ_DBF )

If Len( aInfo ) > 0
logfile( curdir() + "\netz.log", { "directory ok" } )
else
logfile( curdir() + "\netz.log", { "WNETDISCONNECTDLG" } )
endif



05.09.2011 15:49:48: WNETDISCONNECTDLG
05.09.2011 15:49:56: else von ping
05.09.2011 15:49:56: directory ok
05.09.2011 15:49:56: hReturn
05.09.2011 15:49:57: else von ping


Do you think it is possible to use a timer which kills the directory() after 1 sec.
or do you have another solution.

Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Directory()

Postby Antonio Linares » Tue Sep 06, 2011 6:49 pm

Otto,

function Directory() source code is provided in Harbour source code, and it is based -mainly- in two functions hb_fsFindFirst() and hb_fsFindNext(). Here it is:

http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/trunk/harbour/src/rtl/direct.c?revision=14811&view=markup

If the delay comes from hb_fsFindFirst() I guess there is little to do, unless we use a thread to stop it. We have never tried to stop a Windows API function from a thread so this may be our first try :-)

If the delay comes from hb_fsFindNext() then maybe we can control the time between each call to such function and exit Directory() if it takes too long.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Directory()

Postby Antonio Linares » Wed Sep 07, 2011 6:32 pm

Otto,

function Directory( cFileName ) allows to specify the name of the file
to retrieve, this way you don't have to retrieve all files info :-)

Have you tried it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Directory()

Postby Otto » Sat Sep 10, 2011 10:05 am

Hello Antonio,

thank you. I use it like you wrote.
But the timeout is the same.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 6 guests