From: Marc Verkade [Marti IT] on
Hey,

I guess just tooo much files
try this


For nCount:= 1 upto 26
sSeek:=Chr(65+nCount)
aDirectory:=Directory(sSeek+"*.*")
// delete
Nxt nCount

--
Grtz, Marc


"Rob van Erk" <erk.v(a)hotmail.com> schreef in bericht
news:9d1f1e17-8706-4c5a-a567-64f403f8adc0(a)d10g2000yqh.googlegroups.com...
> Hello,
>
> Hope someone can help me urgently with the following problem.
>
> I have a directory on a server with 400000 files and all files with a
> date older then today must be deleted. When startin up Windows
> Explorer it take ages before I can delete the relevant files so I
> thought.... why not using a small VO application.
>
> Why do I get a Dynamic Memory is low (a the aDirectory := Directory
> (..) row) if the number of files in the relevant directory is 400000?
>
> Thanks for any support you can give.
>
> I developed the following source:
>
> METHOD Start() CLASS App
> local aDirectory := {500000} as array
> local l as Long
> local sFile as String
> local aantal as long
> local gevonden as logic
> local ltest as logic
> local suitkomst as string
>
> aDirectory := Directory("D:\Program Files\Rightfax\DocTransport
> \*.IPK","D")
> gevonden := 0
>
> aantal := Len(aDirectory)
>
> if Yesnobox("Warning","'Run test only?")
> ltest := true
> endif
>
> if aantal <> 0
>
> FOR l = 1 to aantal
> IF CToD(AsString(aDirectory[l][F_DATE])) <> Today()
> sFile := "D:\Program Files\Rightfax\DocTransport\" + AsString
> (aDirectory[l] [F_NAME])
> // ? sFile
> gevonden := gevonden + 1
> if !ltest
> ? gevonden
> FErase(sFile)
> endif
> ENDIF
> NEXT
> if ltest
> suitkomst := AsString(gevonden) + ' gevonden'
> else
> suitkomst := AsString(gevonden) + ' gevonden & verwijderd'
> endif
> Showerr(suitkomst)
>
> else
> "Er zijn geen files"
> endif
> return

First  |  Prev  | 
Pages: 1 2
Prev: Harbour 2.0 released
Next: Anchors in CHM besed help