Changeset 2085
- Timestamp:
- 31/01/2008 23:57:14 (4 years ago)
- File:
-
- 1 edited
-
box/trunk/lib/raidfile/RaidFileUtil.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/raidfile/RaidFileUtil.cpp
r217 r2085 23 23 // 24 24 // Function 25 // Name: RaidFileUtil::RaidFileExists(RaidFileDiscSet &, const std::string &) 26 // Purpose: Check to see the state of a RaidFile on disc (doesn't look at contents, 27 // just at existense of files) 25 // Name: RaidFileUtil::RaidFileExists(RaidFileDiscSet &, 26 // const std::string &, int *, int *, int64_t *) 27 // Purpose: Check to see the state of a RaidFile on disc 28 // (doesn't look at contents, just at existence of 29 // files) 28 30 // Created: 2003/07/11 29 31 // … … 55 57 { 56 58 (*pRevisionID) = FileModificationTime(st); 57 #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC 58 // On linux, the time resolution is very low for modification times. 59 // So add the size to it to give a bit more chance of it changing. 59 #ifdef NDEBUG 60 // The resolution of timestamps may be very 61 // low, e.g. 1 second. So add the size to it 62 // to give a bit more chance of it changing. 60 63 // TODO: Make this better. 64 // Disabled in debug mode, to simulate 65 // filesystem with 1-second timestamp 66 // resolution, e.g. MacOS X HFS, Linux. 61 67 (*pRevisionID) += st.st_size; 62 68 #endif … … 72 78 int setSize = rDiscSet.size(); 73 79 int rfCount = 0; 74 #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC 80 75 81 // TODO: replace this with better linux revision ID detection 76 82 int64_t revisionIDplus = 0; 77 #endif 83 78 84 for(int f = 0; f < setSize; ++f) 79 85 { … … 93 99 int64_t rid = FileModificationTime(st); 94 100 if(rid > revisionID) revisionID = rid; 95 #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC96 101 revisionIDplus += st.st_size; 97 #endif98 102 } 99 103 } … … 102 106 { 103 107 (*pRevisionID) = revisionID; 104 #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC 108 #ifdef NDEBUG 109 // The resolution of timestamps may be very low, e.g. 110 // 1 second. So add the size to it to give a bit more 111 // chance of it changing. 112 // TODO: Make this better. 113 // Disabled in debug mode, to simulate filesystem with 114 // 1-second timestamp resolution, e.g. MacOS X HFS, Linux. 105 115 (*pRevisionID) += revisionIDplus; 106 116 #endif
Note: See TracChangeset
for help on using the changeset viewer.
