Newsgroup: it.comp.software.newsreader
Titolo: [Dialog] quanto si allarga!

Uso Dialog in un'unità piccola e non reggo più la grandezza della sua
cartella, è arrivato a 100 mb pur utilizzando un purging settimanale.
Ho notato che nella cartella "data" vi sono msg1.dat e msg2.dat da 10 mb
ognuno (msg3.dat è più piccolo); se provo a cancellarli entrambi Dialog
parte dando un stream error.
Aiutatemi a metterlo a dieta.
-- 
Ciao, MasviL
PGP Key ID: 0x3AF7DD61
ICQ# 5364346

 cartella, è arrivato a 100 mb pur utilizzando un purging settimanale.
Hai provato a compattare il database?
-- 
Bye,3v.
http://trev.altervista.org
	icq:115484489
** Se proprio vuoi scrivermi, usa l'indirizzo del Reply-To **

 Hai provato a compattare il database?
Suggerisco di usare l'ottimo script di Matija per farselo ricordare ogni 
tot giorni (impostabili) in chiusura. Si trova sul Dialog Wiki, comunque 
eccolo qui [prima di usarlo bisogna rimuovere le ||, magari passando dal 
blocco note di Windows per sostituirle con degli spazi ^__^]:
|| 
|| // an onShutDown script that reminds you to compact your database :)
|| // written by matija krnic (matija.krnic -at- 
zg.htnet.hr
)
|| 
|| // this script only works properly on NTFS file systems, as FAT doesn't
|| // have the "last created" date/time, just the "last modified" one.
|| // there's a workaround, but it'll fail each time you set the default
|| // group options. if you don't touch them (which is, i guess, what most
|| // people do since you don't need to alter them after you've configured
|| // them once), the script works normally.
|| 
|| 
|| program OnShutdown;
|| 
|| 
|| const
||   // the path to the 'default.ini' file in your dialog's data folder
||   myDialogDataINI = 'd:\program files\40tude dialog\data\default.ini';
|| 
||   // set this to true if dialog's installed on a FAT partition
||   hackFAT = false;
||   
||   // the time that needs to pass between the last compaction date and
||   // the current time. the number is specified in days and defaults to 7,
||   // but fractions are possible: 7.5 would warn you if seven and a half
||   // days passed since the last time the database was compacted.
||   remindAfter = 7;
|| 
||   // the text in the message box that pops up when it's time to compact.
||   // the '%days%' variable will contain the number specified above.  
||   // the '%lastcompact%' variable will contain the date and time
||   // the database was last compacted on.
||   mbReminderWarning = 'Your database was last compacted on %lastcompact% and it''s already been more than %days% day(s) since. Compact now?';
||   
||   // message box caption
||   mbCaption = 'Compact database reminder';
|| 
|| 
|| 
|| // ----------------------------------------------------------------------
|| // nothing to change down below, go away! ;)
|| // ----------------------------------------------------------------------
|| 
|| 
|| type
||   // this holds the date and time for a file
||   tFileTime = record
||     dwLowDateTime: integer;
||     dwHighDateTime: integer;
||   end;
|| 
||   // and this holds the actual, readable stuff
||   tSystemTime = record
||     wYear: Word;
||     wMonth: Word;
||     wDayOfWeek: Word;
||     wDay: Word;
||     wHour: Word;
||     wMinute: Word;
||     wSecond: Word;
||     wMilliseconds: Word;
||   end;
|| 
|| 
|| const
||   // createFile() constants
||   GENERIC_READ = $80000000;
||   FILE_SHARE_READ = $00000001;
||   FILE_ATTRIBUTE_NORMAL = $00000080;
||   OPEN_EXISTING = 3;
|| 
||   // message box constants
||   MB_YESNO = 4; 
||   IDYES = 6;
||   IDNO = 7;
|| 
||   
|| var
||   // holds the file handle
||   fHandle : integer;      
|| 
||   // tFileTime variables; we only use the creation time in this script
||   myCreationTime, myLastAccessTime, myLastWriteTime : tFileTime;
||   
||   // the original file date and time
||   myUTCSystemTime : tSystemTime;
||   
||   // file date and time with time zone compensation
||   mySystemTime : tSystemTime;
||   
||   // these will hold the date and time values in pascal-usable form
||   myFileDate, myFileTime, myFileDateTime : tDateTime;
||   
||   // the final messagebox string
||   myReminderWarning : string;
|| 
|| 
|| // imported functions. god bless delphi's RTL source and the wonders of copy and paste.
|| function CreateFile(lpFileName: PChar; dwDesiredAccess, dwShareMode: integer; lpSecurityAttributes: pchar; dwCreationDisposition, dwFlagsAndAttributes: integer; hTemplateFile: THandle): THandle; external 'Creat...@kernel32.dll stdcall';
|| function CloseHandle(hObject: THandle): boolean; external 'Close...@kernel32.dll stdcall';
|| function GetFileTime(hFile: integer; var lpCreationTime, lpLastAccessTime, lpLastWriteTime: tFileTime): boolean; external 'GetFi...@kernel32.dll stdcall';
|| function FileTimeToSystemTime(lpFileTime: TFileTime; var lpSystemTime: TSystemTime): boolean; external 'FileTimeTo...@kernel32.dll stdcall';
|| function SystemTimeToTzSpecificLocalTime(lpTimeZoneInformation: pchar; var lpUniversalTime, lpLocalTime: TSystemTime): boolean; external 'SystemTimeToTzS...@kernel32.dll stdcall';
|| function MessageBox(hWnd: longword; lpText, lpCaption: PChar; uType: longword): Integer; external 'Messa...@user32.dll stdcall';
|| 
|| 
|| procedure OnShutdown;
|| Begin
||   // we need a special file handle, normal ones won't do
||   fHandle := createFile(myDialogDataINI, GENERIC_READ, FILE_SHARE_READ, null, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, null);
|| 
||   // obtain the file creation, access and modified times
||   getFileTime(fHandle, myCreationTime, myLastAccessTime, myLastWriteTime);
||   closeHandle(fHandle); 
||   
||   // FAT file system "workaround"
||   if hackFAT
||     // transform last modified file time into system time
||     then fileTimeToSystemTime(myLastWriteTime, myUTCSystemTime)
||     // transform creation file time into system time
||     else fileTimeToSystemTime(myCreationTime, myUTCSystemTime);
||   
||   // compensate for the local time zone
||   systemTimeToTzSpecificLocalTime(null, myUTCSystemTime, mySystemTime);
|| 
||   // encode the system time into two tDateTime structures and merge them  
||   myFileDate := encodeDate(mySystemTime.wYear, mySystemTime.wMonth, mySystemTime.wDay);
||   myFileTime := encodeTime(mySystemTime.wHour, mySystemTime.wMinute, mySystemTime.wSecond, mySystemTime.wMilliseconds);
||   myFileDateTime := myFileDate + myFileTime;
|| 
||   // check the number of days that have passed between the current date/time
||   // and the last compact date
||   if (now - myFileDateTime) >= remindAfter then
||   begin
||     // replace the '%date%' in the reminder warning text with the actual number
||     // and the '%lastcompact%' with the string-formatted last compact date
||     myReminderWarning := stringReplace(mbReminderWarning, '%days%', floatToStrF(remindAfter, ffGeneral, 15, 1), [rfReplaceAll]);
||     myReminderWarning := stringReplace(myReminderWarning, '%lastcompact%', dateTimeToStr(myFileDateTime), [rfReplaceAll]);
|| 
||     // pop up a message box and see if the user wants to compact
||     if (MessageBox(null, myReminderWarning, mbCaption, MB_YESNO) = IDYES) then ADo('CompactDatabase');     
||   end;    
|| 
|| End; // procedure onShutDown
|| 
|| 
|| begin
|| end.
-- 
Fare Well!    FIAG 
http://www.fiag.it
 ~ X-Privat 
http://www.x-privat.org
G             40tude Dialog 2.0.10.1it (beta 33) 
http://snurl.com/dialog
Programmi gratuiti, freeware e non... news:it-alt.comp.software.gratuito
Miranda, Messenger, Trillian news:it-alt.comp.software.instant-messaging

 blocco note di Windows per sostituirle con degli spazi ^__^]:
Volendo si trova tradotto in italiano qui:
http://fido.altervista.org/Dialog/script.html#cdb
-- 
Maria Luisa C - 21/04/04 8.49.26, here.
Tutorial e FAQ in italiano su Dialog:
http://fido.altervista.org/Dialog/dialog.php
http://www.lillathedog.net/dialog/faq.html

 Hai provato a compattare il database?
Sě, adesso, grazie :-)


 tot giorni (impostabili) in chiusura.
Non c'è uno script che lo faccia direttamente?


 Non c'è uno script che lo faccia direttamente?
Dici il Purge? Puoi farlo partire con una ADo('PurgeSubscribedGroups'),
però poi dovrai comunque cliccare su OK :)
