File tree Expand file tree Collapse file tree
lading/src/generator/file_gen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ impl File {
9595 /// TODO these need to modify access time et al
9696 pub fn open ( & mut self , now : Tick ) {
9797 self . advance_time ( now) ;
98+ if now > self . access_tick {
99+ self . access_tick = now;
100+ self . status_tick = now;
101+ }
98102
99103 self . open_handles += 1 ;
100104 }
@@ -109,7 +113,7 @@ impl File {
109113 self . advance_time ( now) ;
110114
111115 assert ! (
112- self . open_handles == 0 ,
116+ self . open_handles > 0 ,
113117 "Attempted to close a file with no open handles"
114118 ) ;
115119 self . open_handles -= 1 ;
@@ -146,10 +150,12 @@ impl File {
146150 /// will be advanced, meaning `modified_tick` may update.
147151 pub fn read ( & mut self , request : u64 , now : Tick ) {
148152 self . advance_time ( now) ;
153+ if now > self . access_tick {
154+ self . access_tick = now;
155+ self . status_tick = now;
156+ }
149157
150158 self . bytes_read = self . bytes_read . saturating_add ( request) ;
151- self . access_tick = now;
152- self . status_tick = now;
153159 }
154160
155161 /// Run the clock forward in the `File`.
You can’t perform that action at this time.
0 commit comments