Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-25 Thread Doriano Blengino
kevinfishburne ha scritto: Doriano Blengino wrote: Read carefully the documentation about the WRITE instruction - in the first few lines you find the explanation. When you write something out, you can specify the length of the data you write. If you don't specify it, gambas will do it

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-25 Thread Doriano Blengino
Doriano Blengino ha scritto: The subroutine could look something like this: sub square_diamond(left, right, top, bottom as integer) step = (right+left) / 2 SORRY: step = (right - left) / 2 Urgh... Regards, Doriano

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-25 Thread Simonart Dominique
Hi, May be I've to elaborate a little bit? I see the process like this: 1) you transpose each cell of your initial array to a pixel of a picture where the coordinates of the pixel is equal to the coordinate of the cell and the grey color of the pixel is equal to the elevation in the cell 2)

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-24 Thread Doriano Blengino
kevinfishburne ha scritto: Kadaitcha Man wrote: Have you tried using a Long instead of an Integer? runs and hides :) Haha, that gave me a good laugh. When I discovered the bug was just me being a jackass I practically did the Snoopy dance I was so overjoyed. Simple problems

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-24 Thread Simonart Dominique
Hi, I've just a crude idea and know nothing more on this subject! If you assume that each value in your big array is a color value instead of an integer, may be you can find some graphic effect wich simulate your algorithm. It seems to me that it's like to find an intermediate color between 2

[Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread kevinfishburne
I need to create an 8 gigabyte binary file with zero values throughout it. Is there a faster way to do this than to create a big string of zeros and write it to the file multiple times? What I'm doing right now works but seems like a really ugly method: ' Zero-out the file. Zero = Chr$(0)

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread Benoît Minisini
I need to create an 8 gigabyte binary file with zero values throughout it. Is there a faster way to do this than to create a big string of zeros and write it to the file multiple times? What I'm doing right now works but seems like a really ugly method: ' Zero-out the file. Zero =

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread kevinfishburne
Benoît Minisini wrote: On Linux, If you seek and write past the real end of a file, then the file is automatically extended. So the simplest is writing where you want in the file only when you need. Just don't do that randomly, to prevent the disk from seeking too much. Most Linux

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread Kadaitcha Man
On 24 January 2010 14:21, kevinfishburne kevinfishbu...@eightvirtues.com wrote: In a terminal, type: info coreutils 'dd' You only need create the file once, then copy it whenever you need to during testing. If you really must create the file every time, let dd do it by using Gambas' Exec

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread nando
This is the absolute fastest way to do it. -Fernando -- Original Message --- From: kevinfishburne kevinfishbu...@eightvirtues.com To: gambas-user@lists.sourceforge.net Sent: Sat, 23 Jan 2010 19:21:33 -0800 (PST) Subject: Re: [Gambas-user] fastest way to zero-out a huge binary

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread kevinfishburne
Kadaitcha Man wrote: In a terminal, type: info coreutils 'dd' You only need create the file once, then copy it whenever you need to during testing. If you really must create the file every time, let dd do it by using Gambas' Exec command. Excellent, thanks. I seem to have found

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread kevinfishburne
kevinfishburne wrote: Excellent, thanks. I seem to have found something horrifying while trying to create the file using GAMBAS however; using the SEEK statement with an argument greater than 2 GB raises a Bad argument error. While that doesn't affect my ability to create the file, it

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread Kadaitcha Man
On 24 January 2010 16:02, kevinfishburne kevinfishbu...@eightvirtues.com wrote: Excellent, thanks. I seem to have found something horrifying while trying to create the file using GAMBAS however; using the SEEK statement with an argument greater than 2 GB raises a Bad argument error. While that

Re: [Gambas-user] fastest way to zero-out a huge binary file

2010-01-23 Thread kevinfishburne
Kadaitcha Man wrote: Have you tried using a Long instead of an Integer? runs and hides :) Haha, that gave me a good laugh. When I discovered the bug was just me being a jackass I practically did the Snoopy dance I was so overjoyed. Simple problems are always the best once you finally