Skip to content
Snippets Groups Projects
Commit 18b1d8e8 authored by rswindell's avatar rswindell
Browse files

When creating a message base with smb_create(), it'll create (or overwrite)

<code>.ini and add a single key to the global/root section:
Created = 0x<time_t> which can be used (e.g. by nntpservice.js) to determine
the date/time the message base was created.
This makes the <code>.ini files an official part of the SMB format. Wheee.
parent 69f08a3f
No related branches found
No related tags found
No related merge requests found
......@@ -1865,6 +1865,7 @@ int SMBCALL smb_create(smb_t* smb)
{
char str[MAX_PATH+1];
smbhdr_t hdr;
FILE* fp;
if(smb->shd_fp==NULL || smb->sdt_fp==NULL || smb->sid_fp==NULL) {
safe_snprintf(smb->last_error,sizeof(smb->last_error),"%s msgbase not open", __FUNCTION__);
......@@ -1891,6 +1892,11 @@ int SMBCALL smb_create(smb_t* smb)
rewind(smb->sid_fp);
chsize(fileno(smb->sid_fp),0L);
SAFEPRINTF(str,"%s.ini",smb->file);
if((fp = fopen(str, "w")) != NULL) {
fprintf(fp, "Created = 0x%lx\n", (long)time(NULL));
fclose(fp);
}
SAFEPRINTF(str,"%s.sda",smb->file);
remove(str); /* if it exists, delete it */
SAFEPRINTF(str,"%s.sha",smb->file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment