Directory function

Directory function

Postby Jack » Thu Jul 16, 2009 8:46 pm

I need to put in a database the name of the directory of a part of the C drive .

I only need the directory and sub directory, not the files

How to ?

Thanks
Jack
 
Posts: 287
Joined: Wed Jul 11, 2007 11:06 am

Re: Directory function

Postby ukoenig » Thu Jul 16, 2009 10:33 pm

Hello Jack,

there is a group of filefunctions like :

cFileSubDir(), cFilePath() ...

have a look at the Help-File, if it is the solution, You are looking for.

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Directory function

Postby nageswaragunupudi » Thu Jul 16, 2009 11:15 pm

You can use this function to get a list of sub-folders in a folder. You can iterate to get sub-folders of these sub-folders again
Code: Select all  Expand view
function SubFolders( cfolder )

   local aSubFolders := {}
   local n
   local aDir        := Directory( cFolder + '\*.*', 'D' )

   for n := 1 to Len( aDir )
      if aDir[ n ][ 5 ] == 'D' .and. Left( aDir[ n ][ 1 ], 1 ) != '.'
         AAdd( aSubFolders, aDir[ n ][ 1 ] )
      endif
   next

return aSubFolders

 
Regards

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

Re: Directory function

Postby Jack » Fri Jul 17, 2009 6:29 am

Thanks for this help,
It works .
Jack
 
Posts: 287
Joined: Wed Jul 11, 2007 11:06 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests