Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!srhqla!quad1!few From: few@quad1.quad.com (Frank Whaley) Newsgroups: comp.os.msdos.programmer Subject: Re: Unique file determination Keywords: Turbo C Checksums Message-ID: <14320@gouda.quad.com> Date: 10 Aug 90 02:00:35 GMT References: <1990Aug9.193919.2996@caen.engin.umich.edu> Organization: Quadratron Systems, Westlake Village, CA Lines: 84 In article <1990Aug9.193919.2996@caen.engin.umich.edu>, mrice@caen.engin.umich.edu (Michael Rice) writes: >What I want to do is store some type of file indentifier for each file >so when I get a new file I can create this identified and check it >against the identifiers for my other files. If they match then I would >know that file is a duplicate. On Unix, the stat() function produces a unique device and inode number for each file. Unfortunately, MS-DOS implementations of stat() typically do not produce unique numbers. Some time back I posted a replacement stat() function which used the "Parent Directory Cluster Number" and "Entry Count In Directory" fields from the ffblk structure to produce a unique inode number. This has worked well enough for me -- I haven't received any bug reports about missing "File in use" messages since the change. The following code demonstrates fetching these magic numbers. ----- #include