EmptyFileValue#

class EmptyFileValue#

Bases: LocalFileValue

Represents an empty file value.

Overview#

write_file

Write the file’s contents to a new file.

get_contents

Read the contents of the file as a string.

actual_content_file_name

Get the path to the file that this FileValue instance wraps.

Import detail#

from ansys.tools.variableinterop.file_value import EmptyFileValue

Property detail#

property EmptyFileValue.actual_content_file_name: os.PathLike | None#

Get the path to the file that this FileValue instance wraps.

Returns:
Optional[PathLike]

PathLike to the file.

Method detail#

abstract async EmptyFileValue.write_file(file_name: os.PathLike) None#

Write the file’s contents to a new file.

Parameters:
file_namePathLike

Path to the file to create.

Returns:
None
abstract async EmptyFileValue.get_contents(encoding: str | None) str#

Read the contents of the file as a string.

Parameters:
encodingOptional[str], optional

Encoding to use when reading. The default is None, in which case the current locale’s encoding is used.

Returns:
str

Contents of the file as a string.