[#BloombergLP-bdls-FilesystemUtil-growFile]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::growFile
:relfileprefix: ../../../
:mrdocs:

Grow the file with the specified `descriptor` to the size of at least the specified `size` bytes&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; If the optionally specified `reserveFlag` is true, make sure the space on disk is preallocated and not allocated on demand, preventing a possible out&hyphen;of&hyphen;disk&hyphen;space error when accessing the data on file systems with sparse file support&period; Preallocation is done by writing unspecified data to file in blocks of the optionally specified `increment` or a default value if `increment` is zero or unspecified&period; Note that if the size of the file is greater than or equal to `size`, this function has no effect&period; Also note that the contents of the newly grown portion of the file is undefined&period;

== Synopsis

Declared in `&lt;bdls&lowbar;filesystemutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
growFile(
    xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FileDescriptor] descriptor,
    xref:BloombergLP/bdls/FilesystemUtil/Offset.adoc[Offset] size,
    bool reserveFlag = false,
    std::size&lowbar;t increment = k&lowbar;DEFAULT&lowbar;FILE&lowbar;GROWTH&lowbar;INCREMENT);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
