**** **** **** **** **** **** **** **** **** **** **** **** 
*proc najdi_datove_adresare

crea table (m.pri_path + "gl_soubory") (adresar c(111), nazev c(44), atrib c(1), delka n(9), datum D )
poradi_adresare = 0

*FOR iii = ASC("c") TO ASC("z") 
FOR iii = ASC("i") TO ASC("j") 
    do jedenadresar with CHR(m.iii) + ":\"
ENDFOR 

sele gl_soubory
do while .t.
    locate for "D" $ atrib .and. delka = 0
    if found()
        repl delka with -1111111
        do jedenadresar with allt(adresar) + allt(nazev) + "\"
    else
        exit
    endif
enddo
WAIT CLEAR 
DELETE FOR ! EMPTY(atrib)
PACK 
SCAN
    IF .not. FILE(ALLTRIM(adresar) + "food_dat.dbf")
        REPLACE atrib WITH "NNN"
    ENDIF 
ENDSCAN 

DELETE FOR ! EMPTY(atrib)
PACK 
INDEX on adresar TAG adresar
SCAN
  adresar = ALLT(gl_soubory.adresar)
  genl_cesticka = m.pri_path + "odeslat\" + STRTRAN(m.adresar, ":\", "-") + "\"
  WAIT "kopirovani " + ALLTRIM(adresar) WINDOW AT 22,22 NOWAIT 
  TRY     
     if ! directory(m.genl_cesticka)
        mkdir (m.genl_cesticka)
     endif

     ftp__txt = ftp__txt + m.adresar + "  "
     COPY FILE (m.adresar + "food_??t.*") TO m.genl_cesticka + "food_??t.*"
     COPY FILE (m.adresar + "err*.*")     TO m.genl_cesticka + "error*.*"
  CATCH 
        *
  FINALLY
  ENDTRY 
ENDSCAN



**** **** **** **** **** **** **** **** **** **** **** **** 
proc jedenadresar
param adresar
IF poradi_adresare > 111
   poradi_adresare = 0
ELSE
   poradi_adresare = m.poradi_adresare + 1
   WAIT ALLTRIM(adresar) + "  " + REPLICATE("*", m.poradi_adresare) WINDOW AT 22,22 NOWAIT 
ENDIF 

IF (":\windows" $ m.adresar) .or. ;
   (":\program files" $ m.adresar) .or. ;
   (":\documents and settings" $ m.adresar) .or. ;
   (":\i386" $ m.adresar) .or. ;
   (":\tmp" $ m.adresar) .or. (":\temp" $ m.adresar)
        retu
ENDIF 
pocet = adir(qqq, m.adresar + "*.*", "D")
for ii = 1 to m.pocet
  if left(qqq(ii, 1), 1) # "."
     DO case
     CASE ("D" $ qqq(ii, 5)) .and. AT("\", m.adresar, 4) = 0    && maximalni uroven vnoreni adresare
         insert into gl_soubory (adresar, nazev, atrib, delka, datum) ;
                value (lowe(m.adresar), lowe(qqq(ii, 1)), "D", qqq(ii, 2), qqq(ii, 3))
     CASE lowe(qqq(ii, 1)) = "food_set.dbf"
         insert into gl_soubory (adresar, nazev, atrib, delka, datum) ;
                value (lowe(m.adresar), lowe(qqq(ii, 1)), "", qqq(ii, 2), qqq(ii, 3))
     ENDCASE 
  endif
endfor
