EmptyFileValue#

class ansys.tools.variableinterop.file_value.EmptyFileValue#

Bases: LocalFileValue

Represents an empty file value.

Generally speaking, you should not create an instance of this class but instead use ansys.tools.variableinterop.EMPTY_FILE.

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 EmptyFileValue.write_file(file_name: os.PathLike) None#
Async:

Write the file’s contents to a new file.

Parameters:
file_namePathLike

Path to the file to create.

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

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.