Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-15 Thread Reinier Olislagers
On 13/09/2013 16:17, Michael Van Canneyt wrote: > On Fri, 13 Sep 2013, Reinier Olislagers wrote: >> On 13/09/2013 15:38, Marco van de Voort wrote: >>> In our previous episode, Reinier Olislagers said: However, I'm sure there must be quicker ways (e.g. less newbie code; using OS functions

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Reinier Olislagers
On 13/09/2013 16:17, Michael Van Canneyt wrote: > Attached a NullStream implementation. > Thanks ;) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Michael Van Canneyt
On Fri, 13 Sep 2013, Reinier Olislagers wrote: On 13/09/2013 15:38, Marco van de Voort wrote: In our previous episode, Reinier Olislagers said: However, I'm sure there must be quicker ways (e.g. less newbie code; using OS functions to quickly create empty memor, or alternatively create a spa

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Reinier Olislagers
On 13/09/2013 15:12, Ewald wrote: > Once upon a time, Reinier Olislagers said: >> >> However, I'm sure there must be quicker ways (e.g. less newbie code; >> using OS functions to quickly create empty memor, or alternatively >> create a sparse file and zip the file instead of the stream). > Have you

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Reinier Olislagers
On 13/09/2013 15:38, Marco van de Voort wrote: > In our previous episode, Reinier Olislagers said: >> However, I'm sure there must be quicker ways (e.g. less newbie code; >> using OS functions to quickly create empty memor, or alternatively >> create a sparse file and zip the file instead of the st

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Reinier Olislagers
On 13/09/2013 15:19, Bart wrote: > On 9/13/13, Reinier Olislagers wrote: >> ContentStream.SetSize(1+$); //4 bytes+1 > > Actually 4 GB : 4294967295 + 1 = 4294967296 = 4 * 1024 * 1024 * 1024 Yes... but I had trouble counting Fs, so that reminder makes more sense to me ;) > Now you have

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Marco van de Voort
In our previous episode, Reinier Olislagers said: > However, I'm sure there must be quicker ways (e.g. less newbie code; > using OS functions to quickly create empty memor, or alternatively > create a sparse file and zip the file instead of the stream). Do not create the data, but generate it in a

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Bart
On 9/13/13, Reinier Olislagers wrote: > I'm working on implementing zip64 support and trying to test things by > compressing large files or streams using FPC's zip code. > > Currently using this to get a huge memorystream filled with the same > data - so it should compress very well: > ... > Con

Re: [fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Ewald
Once upon a time, Reinier Olislagers said: > > However, I'm sure there must be quicker ways (e.g. less newbie code; > using OS functions to quickly create empty memor, or alternatively > create a sparse file and zip the file instead of the stream). Have you tried FillChar(), FillDWord(), ... I not,

[fpc-pascal] Get empty memory quickly or... an empty file

2013-09-13 Thread Reinier Olislagers
I'm working on implementing zip64 support and trying to test things by compressing large files or streams using FPC's zip code. Currently using this to get a huge memorystream filled with the same data - so it should compress very well: ... ContentStream:=TMemoryStream.Create(); ContentStream.