readAttributes

inline fun <A : BasicFileAttributes> Path.readAttributes(vararg options: LinkOption): A(source)

Reads a file's attributes of the specified type A in bulk.

Since Kotlin

1.5

Parameters

A

the reified type of the desired attributes, a subtype of BasicFileAttributes.

See also

Throws

if the given attributes type A is not supported.


inline fun Path.readAttributes(attributes: String, vararg options: LinkOption): Map<String, Any?>(source)

Reads the specified list of attributes of a file in bulk.

The list of attributes to read is specified in the following string form:

[view:]attribute_name1[,attribute_name2...]

So the names are comma-separated and optionally prefixed by the attribute view type name, basic by default. The special * attribute name can be used to read all attributes of the specified view.

Since Kotlin

1.5

Return

a Map having an entry for an each attribute read, where the key is the attribute name and the value is the attribute value.

See also

Throws

if the attribute view is not supported.

if no attributes are specified or an unrecognized attribute is specified.