[BUG] large files?

John M McIntosh johnmci at smalltalkconsulting.com
Wed Nov 7 19:32:36 UTC 2001


Mmm since I've the file primitives all spread apart on my workbench 
to fix this mac alias problem I'm wondering if there is interested in 
and or we should look at:

large > 2GB files.

IE usage of ftello fseeko

I'd think I would need to change the file plugin to look for large 
integers, oh say 64bit values?

I did notice that mostly the code seems to handle 32bit positive 
values ok, ie fseek grabs the position as

newPosition _ interpreterProxy positive32BitValueOf: 
(interpreterProxy stackValue: 0).


However for file read and write we grab the data with
	count		_ interpreterProxy stackIntegerValue: 0.
	startIndex	_ interpreterProxy stackIntegerValue: 1.

which *I believe* then limits you to a start and count value of < 
1GB. Yes some testing shows once startIndex exceeds SmallInteger 
maxVal then stackIntegerValue returns zero. Which isn't what you 
want, so that is broken.

Anyone here actually play with > 1GB files with Squeak? Or maybe 5GB files

Seems I've only a GB or so of free disk space on my working machine, 
any squeakers out there care to do some testing? Although I think I 
know the answer is you won't get beyond 1GB.

PS and why does

positive32BitIntegerFor: integerValue

..
	newLargeInteger _
		self instantiateSmallClass: (self splObj: 
ClassLargePositiveInteger)
				sizeInBytes: 8
...						 fill: 0.

create a large positive integer of 8 bytes, versus say of 4?

-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================




More information about the Squeak-dev mailing list