[#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. Return 0 on success, and a non‐zero value otherwise. If the optionally specified `reserveFlag` is true, make sure the space on disk is preallocated and not allocated on demand, preventing a possible out‐of‐disk‐space error when accessing the data on file systems with sparse file support. 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. Note that if the size of the file is greater than or equal to `size`, this function has no effect. Also note that the contents of the newly grown portion of the file is undefined. == Synopsis Declared in `<bdls_filesystemutil.h>` [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_t increment = k_DEFAULT_FILE_GROWTH_INCREMENT); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#