two functions

two functions

Postby Silvio » Mon Jun 08, 2009 4:48 pm

where I can found LFNFILE() and LFNDIRECTORY() ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: two functions

Postby Antonio Linares » Mon Jun 08, 2009 5:34 pm

Silvio,

File() and Directory() should be able to manage LFN.
regards, saludos

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

Re: two functions

Postby Silvio » Mon Jun 08, 2009 5:52 pm

sorry,
But I have a old source code and not founded these funcs when I compiled it
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: two functions

Postby StefanHaupt » Tue Jun 09, 2009 7:05 am

Code: Select all  Expand view
FUNCTION LfnFile(cF)
RETURN (File(cF))

FUNCTION LfnDirectory(cD)
RETURN (Directory (cD))
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: two functions

Postby driessen » Tue Jun 09, 2009 11:20 am

Silvio,

This is the LFNFILE function I use :
Code: Select all  Expand view

#INCLUDE "STRUCT.CH"
#DEFINE MAX_PATH 260
#DEFINE FILE_ATTRIBUTE_READONLY 1
#DEFINE FILE_ATTRIBUTE_HIDDEN 2
#DEFINE FILE_ATTRIBUTE_SYSTEM 4
#DEFINE FILE_ATTRIBUTE_DIRECTORY 16
#DEFINE FILE_ATTRIBUTE_ARCHIVE 32
#DEFINE FILE_ATTRIBUTE_NORMAL 128
#DEFINE FILE_ATTRIBUTE_TEMPORARY 256
******************************************************************************
DLL32 FUNCTION FINDFIRSTFILE(cFileName AS LPSTR,cFindFileData AS LPSTR) AS LONG PASCAL FROM "FindFirstFileA" LIB "kernel32.dll"
DLL32 FUNCTION FINDCLOSE(nFindFile AS LONG) AS BOOL PASCAL FROM "FindClose" LIB "kernel32.dll"
******************************************************************************

FUNCTION LFNFILE(cFile)

   LOCAL oWin32FindData := OWIN32FINDDATA()
   LOCAL hFile

   hFile := FINDFIRSTFILE(cFile,oWin32FindData:cBuffer)

   FINDCLOSE(hFile)

RETURN(hFile <> -1 .AND. NAND(oWin32FindData:nFileAttr,FILE_ATTRIBUTE_DIRECTORY) = 0)

******************************************************************************

STATIC FUNCTION OWIN32FINDDATA

   LOCAL oWin32FindData

   STRUCT oWin32FindDATA
          MEMBER nFileAttr  AS DWORD
          MEMBER cCreatTime AS STRING LEN 10
          MEMBER cLastATime AS STRING LEN 10
          MEMBER cLastWTime AS STRING LEN 10
          MEMBER nFileSizeH AS DWORD
          MEMBER nFileSizeL AS DWORD
          MEMBER nReserved0 AS DWORD
          MEMBER nReserved1 AS DWORD
          MEMBER cFileName  AS STRING LEN MAX_PATH
          MEMBER cShortName AS STRING LEN 14
   ENDSTRUCT

RETURN(oWin32FindData)
 

I can't remember who send it to me but it is working just fine.

Good luck.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wartiaga and 85 guests