Hi,

I noticed that many files on my FreeDOS partition do not have a creation  
time, or rather they claim to be created in 1980. For a long time I  
thought that this is a bug, but today I looked at the kernel source code  
and found out that file creation times are never actually set.

The file hdr\fat.h does define "dir_crtime" and "dir_crdate" in the  
"dirent" structure, but a search didn't reveal them being used anywhere.

I compiled myself a new kernel with two simple changes to init_direntry in  
kernel\fatfs.c:

STATIC void init_direntry(struct dirent *dentry, unsigned attrib,
                           CLUSTER cluster, char *name)
{
   dentry->dir_size = 0l;
   memset(dentry, 0, sizeof(struct dirent));
   memcpy(dentry->dir_name, name, FNAME_SIZE + FEXT_SIZE);
#ifdef WITHFAT32
   dentry->dir_start_high = (UWORD)(cluster >> 16);
#endif
   dentry->dir_start = (UWORD)cluster;
   dentry->dir_attrib = (UBYTE)attrib;
dentry->dir_crtime =  // add this
   dentry->dir_time = dos_gettime();
dentry->dir_crdate =  // and this
   dentry->dir_date = dos_getdate();
}

And now when I create files in FreeDOS, Windows shows the correct creation  
times. I don't know whether any DOS program actually displays them, but  
they are an important thing to me...

This message

http://www.mail-archive.com/freedos-user%40lists.sourceforge.net/msg01105.html

and this Wikipedia article

https://en.wikipedia.org/w/index.php?title=Design_of_the_FAT_file_system&oldid=614948461#Directory_entry

both mention file creation times as something that was added to the FAT  
design at the same time as long filenames. Does the FreeDOS kernel not  
support them because of patent issues? I can hardly imagine a simple  
feature like this being patented.

So is there any reason they're not supported or is this just an oversight?

Matej Horvat
http://matejhorvat.si/

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to