File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,7 @@ static int Get_File_Info(REBREQ *file)
486
486
***********************************************************************/
487
487
{
488
488
ssize_t num_bytes ;
489
+ struct stat info ;
489
490
490
491
if (!file -> id ) {
491
492
file -> error = - RFE_NO_HANDLE ;
@@ -512,8 +513,13 @@ static int Get_File_Info(REBREQ *file)
512
513
else file -> error = - RFE_BAD_WRITE ;
513
514
return DR_ERROR ;
514
515
} else {
516
+ //SET_FLAG(file->modes, RFM_RESEEK);
515
517
file -> actual = (u32 )num_bytes ;
516
518
}
519
+ if (fstat (file -> id , & info ) == 0 ) {
520
+ file -> file .size = info .st_size ;
521
+ file -> file .time .l = (i32 )(info .st_mtime );
522
+ }
517
523
518
524
return DR_DONE ;
519
525
}
Original file line number Diff line number Diff line change @@ -337,6 +337,21 @@ if system/platform = 'Windows [
337
337
--assert "Hella World! Goodbye World!" = to-string read /seek f 0
338
338
--assert port? close f
339
339
try [delete %file-552 ]
340
+ --assert all [
341
+ port? p: open /new %file-552
342
+ file? write p "a"
343
+ tail? read p
344
+ file? write p "b"
345
+ tail? read p
346
+ #{ 6162 } = read /seek p 0
347
+ tail? read p
348
+ file? write /seek p "c" 0
349
+ #{ 62 } = read p
350
+ #{ 6362 } = read /seek p 0
351
+ 2 = length? p
352
+ port? close p
353
+ ]
354
+ try [delete %file-552 ]
340
355
341
356
--test-- "clear file port"
342
357
;@@ https://github.com/Oldes/Rebol-issues/issues/812
You can’t perform that action at this time.
0 commit comments