How to create an "empty" file (each byte content = 0) with a specific size (very large) very fast ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create an "empty" file (each byte content = 0) with a specific size (very large) very fast ?

GLASS mailing list
Does anyone know how to do this ?

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How to create an "empty" file (each byte content = 0) with a specific size (very large) very fast ?

GLASS mailing list
Hi Marten,

I know how to do it in C but not in ST.  We do this very thing when we grow database extents to a larger size.  It's a little tricky because simply changing the file size does not guarantee the space in the file will be available when it's written to.

A small user action that does this could be written in C, then the user action could be called from Smalltalk in GemStone.

I will also submit a  feature request to do this from GsFile in a future release.

Norm Green


On 6/22/2020 7:05 AM, Marten Feldtmann via Glass wrote:
Does anyone know how to do this ?

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How to create an "empty" file (each byte content = 0) with a specific size (very large) very fast ?

GLASS mailing list
In reply to this post by GLASS mailing list
Hi Marten,

On Linux, the command "fallocate" does this quite nicely. If you want to do it from within Smalltalk, I'd think that invoking fallocate using #performOnServer: would work.

Regards,
-Martin

On 6/22/20 7:05 AM, Marten Feldtmann via Glass wrote:
Does anyone know how to do this ?

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: How to create an "empty" file (each byte content = 0) with a specific size (very large) very fast ?

GLASS mailing list
Hello Martin,

that's working !

Marten
Martin McClure <[hidden email]> hat am 22. Juni 2020 um 18:21 geschrieben:

Hi Marten,

On Linux, the command "fallocate" does this quite nicely. If you want to do it from within Smalltalk, I'd think that invoking fallocate using #performOnServer: would work.

Regards,
-Martin

On 6/22/20 7:05 AM, Marten Feldtmann via Glass wrote:
Does anyone know how to do this ?

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass


 

_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass