Pessoal,
Tem como procurar um arquivos em todas as pasta do computador como no antigo DOS exemplo: dir arquivo.txt /s

Moderador: Moderadores
Eu testei e ficou extremamente pesada. E em alguma vezes falou.
#include <hmg.ch>
Function Main()
Local aFiles:=DirectoryRecurse( "C:\Fontes\HMG\*.prg" )
MsgDebug(aFiles)
// MsgList(aFiles)
Return Nil
PROCEDURE Main
? time()
aDir := DirectoryRecurse( "d:\inetpub\wwwroot\xmlpdf\*.xml" )
? Len( aDir )
? time()
RETURN
2008-07-25 15:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/xhb/Makefile
* harbour/contrib/xhb/common.mak
+ harbour/contrib/xhb/dirrec.prg
+ added DirectoryRecurse() function. It's not exactly xHarbour
compatible as I wanted at the beginning. But when I begin
to carefully check what xHarbour exactly does then I dropped
the strict compatibility due to problems with xHarbour
implementation which have to be fixed. I left this note in the
dirrec.prg header:
This implementation uses different rules then xHarbour one.
It does not change current drive or current directory so
unlike the xHarbour version it's MT safe.
It also returns relative paths which are more similar to
DIRECTORY() function results so they can be easy used
directly in other code, f.e. to create archive without
absolute paths. Please note that user can easy convert
relative paths to absolte ones by simple adding curdir()
and/or cPath parameter passed to DirectoryRecurse() but
reverted conversion may not be possible in some cases.
The 3-rd xHarbour parameter <lCaseMach> is ignored because
harbour uses platform native rules to check filename mask
respecting SET FILECASE and SET DIRCASE settings.
xHarbour does not add "D" to attribute list used for directory
tree scanning so user always have to add it manually and later
it ignores it so it's not possible to extract file list with
directories entries. In Harbour it's fixed.
hb_FNameSplit()
Run Dir \Clientes.Prg /S /B > Result.Tmp
#include "FiveWin.ch" // basta comentar para modo console
FUNCTION Main()
LOCAL cArq, cExt, cPath, cFile, cEncontrou, nI
cArq := ""
cExt := ""
cPath := ""
cPath := "C:\FWH1306\SAMPLES\"
cFile := "TESTE.PRG"
// aFile := DIRECTORYRECURSE( cPath + cFile )
// ou:
aFile := DIRECTORY( cPath + cFile )
If Len(aFile)==0
? "Arquivo Não Encontrado"
Else
For nI := 1 to Len( aFile )
hb_FNameSplit( aFile[nI,1], @cPath, @cArq, @cExt )
? cPath+" "+cArq+" "+cExt+" Perfeito, encontrou!"
Next
aFiles := ALLTRIM( cPath+cArq+cExt )
cEncontrou := aFiles
IF FILE( cEncontrou ) // Encontrou, mostra...
? cEncontrou
ENDIF
EndIf
RETURN NIL
Pessoal o que estava querendo dizer e no modo de programacao XHARBOUR e vi alguns exemplos mais gostaria de saber era o seguinte uma pessoa baixa um arquivo de um email ai gostaria de pesquisa em todo o HD para pegar este arquivo sem saber onde foi baixado tem como ?
Usuários vendo este fórum: Google [Bot], Google Adsense [Bot] e 7 visitantes