+ if (timeStamps && !(drive->type==CPMFS_P2DOS || drive->type==CPMFS_DR3)) /*{{{*/
+ {
+ int offset,j;
+ struct cpmInode ino, root;
+ static const char sig[] = "!!!TIME";
+ unsigned int records;
+ struct dsDate *ds;
+ struct cpmSuperBlock super;
+ const char *err;
+
+ if ((err=Device_open(&super.dev,name,O_RDWR,NULL)))
+ {
+ fprintf(stderr,"%s: can not open %s (%s)\n",cmd,name,err);
+ exit(1);
+ }
+ cpmReadSuper(&super,&root,format,uppercase);
+
+ records=root.sb->maxdir/8;
+ if (!(ds=malloc(records*128)))
+ {
+ cpmUmount(&super);
+ return -1;
+ }
+ memset(ds,0,records*128);
+ offset=15;
+ for (i=0; i<records; i++)
+ {
+ for (j=0; j<7; j++,offset+=16)
+ {
+ *((char*)ds+offset) = sig[j];
+ }
+ /* skip checksum byte */
+ offset+=16;
+ }
+
+ /* Set things up so cpmSync will generate checksums and write the
+ * file.
+ */
+ if (cpmCreat(&root,"00!!!TIME&.DAT",&ino,0)==-1)
+ {
+ fprintf(stderr,"%s: Unable to create DateStamper file: %s\n",cmd,boo);
+ return -1;
+ }
+ root.sb->ds=ds;
+ root.sb->dirtyDs=1;
+ cpmUmount(&super);
+ }
+ /*}}}*/
+