fileref.py

Support for file variables.

class openmdao.core.fileref.FileRef(fname=None, parent_dir=None)[source]

Bases: object

A reference to a file on disk. As well as containing metadata information, it supports open() to read and write the file’s contents.

open(mode)[source]

Open file for reading or writing.

validate(src_fref)[source]

validate() is called on a target FileRef to ensure that the source is a FileRef and that it has matching metadata. Currently, the only metadata is a binary flag. Other metadata may be added in the future. If the metadata does not match, an exception will be raised.

Args:

src_fref : FileRef

Source FileRef object.