Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001305 [Squeak] Files minor always 06-03-05 21:16 12-12-05 11:24
Reporter chris View Status public  
Assigned To andreas
Priority normal Resolution open  
Status assigned   Product Version 3.8
Summary 0001305: StandardFileStream>>truncate: bug
Description After using myFileStream>>#truncate:, the #size of the file still reflects the old size until you #close and then #open the file.

The size of the file should reflect what it was truncated to.
Additional Information
Attached Files

- Relationships

- Notes
(0002912 - 434 - 948 - 948 - 1040 - 1040 - 1040)
cdegroot
10-19-05 23:57

Reproducable on Win32. Seems to be in the primitives...

testTruncate
    "Mantis 0001305"
    | stream |
    [(FileDirectory default forceNewFileNamed: 'filestream.tst')
        nextPutAll: '42';
        close.
    
    stream := FileDirectory default oldFileNamed: 'filestream.tst'.
    [stream truncate.
    self assert: stream size = 0]
        ensure: [stream close]
    ]
        
        ensure: [FileDirectory default deleteFileNamed: 'filestream.tst' ifAbsent: nil]
 
(0002913 - 167 - 173 - 173 - 173 - 173 - 173)
cdegroot
10-20-05 00:10

On Win32, sqFileSize in the sqWin32FilePlugin.c returns f->fileSize instead of going to the OS. Which probably means that the truncate function should fix f->fileSize.
 
(0003287 - 62 - 62 - 62 - 62 - 62 - 62)
cdegroot
12-12-05 11:24

Andreas - could you check whether my analysis is correct here?
 

- Issue History
Date Modified Username Field Change
06-03-05 21:16 chris New Issue
06-03-05 21:18 chris Issue Monitored: chris
10-19-05 21:55 cdegroot Status new => assigned
10-19-05 21:55 cdegroot Assigned To  => cdegroot
10-19-05 23:33 cdegroot Category System => Files
10-19-05 23:57 cdegroot Note Added: 0002912
10-20-05 00:10 cdegroot Note Added: 0002913
12-12-05 11:23 cdegroot Assigned To cdegroot => andreas
12-12-05 11:24 cdegroot Note Added: 0003287


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
47 total queries executed.
35 unique queries executed.
Powered by Mantis Bugtracker