[#BloombergLP-bdls-FilesystemUtil-truncateFileSize] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::truncateFileSize :relfileprefix: ../../../ :mrdocs: Set the size of the file referred to by the specified `descriptor` to the specified `size`. `descriptor` must be open for writing. After the function call, the position is set to the end of the file. Return 0 on success and a non‐zero value otherwise. The behavior is undefined if the file is currently mapped, or if `size` is greater than the existing size of the file. == Synopsis Declared in `<bdls_filesystemutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int truncateFileSize( xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FileDescriptor] descriptor, xref:BloombergLP/bdls/FilesystemUtil/Offset.adoc[Offset] size); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#