Volume creation date

4 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2014-04-21 21:15
Volume creation date

I am trying to a volume's creation date (DH0:, DF1:, etc). I am not getting the correct datestamp value.

  1. BOOL
  2. GetDevices(VOID)
  3. {
  4. BOOL Success=TRUE;
  5. struct DosList *doslist;
  6. BPTR lock;
  7. TEXT Temp1[128], Temp2[128];
  8. struct DevProc *devProc=NULL;
  9. struct FileSystemData *filesys;
  10.  
  11. DisableRequesters();
  12.  
  13. if ((doslist=IDOS->LockDosList(LDF_DEVICES | LDF_READ)))
  14. {
  15. while((doslist=IDOS->NextDosEntry(doslist,LDF_DEVICES)))
  16. {
  17. IUtility->SNPrintf(Temp1,128,"%s:",(STRPTR)BADDR(doslist->dol_Name)+1);
  18.  
  19. DevicesNode->DOSType=doslist->dol_misc.dol_volume.dol_DOSType;
  20. // FileSystem
  21.  
  22. LocaleDateBufferPos=0;
  23. ILocale->FormatDate(Locale,"%d-%b-%y %T",&doslist->dol_misc.dol_volume.dol_VolumeDate,putCharHook);
  24. IUtility->Strlcpy(DevicesNode->CreationDate,LocaleDateBuffer,20);
  25.  
  26. }
  27.  
  28. IDOS->UnLockDosList(LDF_DEVICES | LDF_READ);
  29. }
  30.  
  31. EnableRequesters();
  32.  
  33. return(Success);
  34. }

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.

broadblues
broadblues's picture
Offline
Last seen: 4 years 10 months ago
Joined: 2012-05-02 21:48
Re: Volume creation date

If you want info about a volume it's best to use LDF_VOLUMES not LDF_DEVICES :-)

mritter0
mritter0's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2014-04-21 21:15
Re: Volume creation date

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.

thomas
thomas's picture
Offline
Last seen: 1 week 6 hours ago
Joined: 2011-05-16 14:23
Re: Volume creation date

I was hoping it would fill all the structs in for each type.

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.

Log in or register to post comments