I am trying to a volume's creation date (DH0:, DF1:, etc). I am not getting the correct datestamp value.
BOOL GetDevices(VOID) { BOOL Success=TRUE; struct DosList *doslist; BPTR lock; TEXT Temp1[128], Temp2[128]; struct DevProc *devProc=NULL; struct FileSystemData *filesys; DisableRequesters(); if ((doslist=IDOS->LockDosList(LDF_DEVICES | LDF_READ))) { while((doslist=IDOS->NextDosEntry(doslist,LDF_DEVICES))) { IUtility->SNPrintf(Temp1,128,"%s:",(STRPTR)BADDR(doslist->dol_Name)+1); DevicesNode->DOSType=doslist->dol_misc.dol_volume.dol_DOSType; // FileSystem LocaleDateBufferPos=0; ILocale->FormatDate(Locale,"%d-%b-%y %T",&doslist->dol_misc.dol_volume.dol_VolumeDate,putCharHook); IUtility->Strlcpy(DevicesNode->CreationDate,LocaleDateBuffer,20); } IDOS->UnLockDosList(LDF_DEVICES | LDF_READ); } EnableRequesters(); return(Success); }
The date should be: 30-Sep-14 20:03:10
I get: 06-Jan-78 16:32:00
All the devices I check are in 1978.
And is the DOSType being checked correctly? DevicesNode->DOSType is an int32.
If you want info about a volume it's best to use LDF_VOLUMES not LDF_DEVICES :-)
Yes, that was it. I was hoping it would fill all the structs in for each type. Have to do it in 2 steps now. It's done.
Have a deeper look into the include file. They are not seperate structs, they are parts of a union. What is a DateStamp for a volume is used as Handler / StackSize / Priority for a device.