grazie per l'aiuto su sqlite.ho creato un gestore di db per mio figlio che va un amore.adesso sono impegnato in un front-end per ClamAV.poichè avrei bisogno di vedere i file che sono in scanzione,vorrei sapere se cè un metodo/evento/propietà
che prenda,senza usare il timer,i file in scanzione.esempio col timer(basato su quello che si trova nel doc di gambas)
PUBLIC SUB _new()
END
PUBLIC SUB Form_Open()
ME.Center
Timer1.Enabled = TRUE
END
PUBLIC SUB Form_Close()
Timer1.Enabled = FALSE
END
PUBLIC SUB Timer1_Timer()
DIM sRes AS String, sVal AS String, sTotal AS String, aRes AS String[]
DIM cVal AS NEW Collection
SHELL "cat /proc/meminfo" TO sRes
FOR EACH sVal IN Split(sRes, "\n", "", TRUE)
aRes = Split(sVal, " ", "", TRUE)
cVal[Left$(aRes[0], -1)] = aRes[1]
NEXT
sTotal = cVal!MemTotal - cVal!MemFree - cVal!Buffers - cVal!Cached + cVal!SwapTotal - cVal!SwapFree - cVal!SwapCached
TextArea1.Text = "Memoria in uso : " & (CInt(sTotal) / 1024) & " mbyte" & "\n"
TextArea1.Text &= "Memoria totale : " & (CInt(cVal!MemTotal) / 1024) & " mbyte" & "\n"
TextArea1.Text &= "Memoria libera : " & (CInt(cVal!MemFree) / 1024) & " mbyte" & "\n"
TextArea1.Text &= "Memoria buffer : " & (CInt(cVal!Buffers) / 1024) & " mbyte" & "\n"
TextArea1.Text &= "Memoria cached : " & (CInt(cVal!Cached) / 1024) & " mbyte" & "\n"
TextArea1.Text &= "Memoria Swap(total) : " & (CInt(cVal!SwapTotal) / 1024) & " mbyte" & "\n"
TextArea1.Text &= "Memoria Swap(libera) : " & (CInt(cVal!SwapFree) / 1024) & " mbyte" & "\n"
TextArea1.Text &= "Memoria Swap(cached) : " & (CInt(cVal!SwapCached) / 1024) & " mbyte"
END
puoi usare qualcosa del genere...
' Gambas class file
PUBLIC Process AS Process
PUBLIC SUB Button1_Click()
SHELL "clamscan -v" FOR READ
END
PUBLIC SUB Process_Read()
DIM sLine AS String
DIM content AS String
READ #LAST, sLine, -256
Content = Content & sLine
editor1.Text = sLine
END
naturalmente devi modificare il comando della shell per scansionare la directory o il file corretto,
ho fatto una prova con
shell "clamscan / -v -r " FOR READ
ma la scansione dei vari file è talmente veloce da risultare illeggibile
il mio gambas è un pò strano.... :-)
PUBLIC Proceso AS Process
PUBLIC SUB picClamScan_MouseDown()
SHELL "clamscan -v" FOR READ AS "Proceso"
END
PUBLIC SUB Proceso_Read()
DIM sLine AS String
READ #LAST, sLine, -256
TextArea2.Text &= sLine
END
adesso va,ma non è che è molto veloce.se non ch'è un problema di priorità di eventi.in VB6 si soluzionava con DOEVENTS.in gambas??
grazie a tutti,cmq ho soluzionato con :
SHELL "clamscan -r /home/alejandro/Documenti/Doc" WAIT FOR READ AS "Proceso"
:-)
non appena finisco il codice vi spedisco il tutto 8-)