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

This `struct` provides a namespace for a `std&colon;&colon;filesystem&colon;&colon;perms`&hyphen;style enumeration of file&hyphen;system permission bits, and a pair of predicates for validating an `int` bit mask against that enumeration&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct FilePermissions;
----

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdls/FilePermissions/Enum.adoc[`Enum`] 
| File&hyphen;system permission bits, in the conventional Unix octal layout&period; Values may be combined with the bitwise&hyphen;OR operator&period; See the component&hyphen;level documentation for the meaning of each enumerator&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdls/FilePermissions/isValid.adoc[`isValid`] 
| Return `true` if the specified `permissions` bit mask consists only of bits defined in `Enum` (i&period;e&period;, bits in `k&lowbar;MASK`), and `false` otherwise&period; A negative value always returns `false`&period;
| xref:BloombergLP/bdls/FilePermissions/isValidBaseBits.adoc[`isValidBaseBits`] 
| Return `true` if the specified `permissions` bit mask consists only of the &quot;base&quot; nine rwx bits (owner&sol;group&sol;others read&sol;write&sol;execute, i&period;e&period;, bits in `k&lowbar;ALL`), and `false` otherwise&period; Note that this predicate is stricter than `isValid`&colon; `k&lowbar;SET&lowbar;UID`, `k&lowbar;SET&lowbar;GID`, and `k&lowbar;STICKY&lowbar;BIT` are rejected&period;
| xref:BloombergLP/bdls/FilePermissions/print.adoc[`print`] 
| Write the octal numeric representation of the specified permission bit mask `value` to the specified output `stream`, and return a reference to `stream`&period; Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects&period; If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; The `value` is written in octal notation _without_ the customary leading `0` prefix (for example, the mask `0640` is written as `640`)&period;
|===



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