[#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`&period; `descriptor` must be open for writing&period; After the function call, the position is set to the end of the file&period; Return 0 on success and a non&hyphen;zero value otherwise&period; The behavior is undefined if the file is currently mapped, or if `size` is greater than the existing size of the file&period;

== Synopsis

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

[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]#
