PSCF v1.3
pscfpp.file.File Class Reference

Class that contains metadata for a file. More...

Inheritance diagram for pscfpp.file.File:
pscfpp.file.Directory

Public Member Functions

 __init__ (self, path=None, scan=1)
 Constructor.
 __str__ (self)
 String representation of file data.
 __repr__ (self)
 String representation of file data.
 open (self, mode)
 Open this file in specified mode.
 write (self, filename)
 Write XML representation to a file.
 __eq__ (self, other)
 Test for equality of files.
 __ne__ (self, other)
 Test for inequality of files.

Detailed Description

Class that contains metadata for a file.

Definition at line 103 of file file.py.

Constructor & Destructor Documentation

◆ __init__()

pscfpp.file.File.__init__ ( self,
path = None,
scan = 1 )

Constructor.

Parameters
pathpath to file
scanbool flag to scan time and size

Definition at line 110 of file file.py.

References mtime, path, scan, Pscf::Prdc::Basis< D >::Star.size, and size.

Member Function Documentation

◆ __str__()

pscfpp.file.File.__str__ ( self)

String representation of file data.

Definition at line 120 of file file.py.

References path.

Referenced by pscfpp.output.State.write(), and pscfpp.output.Thermo.write().

◆ __repr__()

pscfpp.file.File.__repr__ ( self)

String representation of file data.

Definition at line 126 of file file.py.

References mtime, path, Pscf::Prdc::Basis< D >::Star.size, and size.

◆ open()

pscfpp.file.File.open ( self,
mode )

Open this file in specified mode.

Parameters
modemode for opening, e.g., 'w' or 'r'

Definition at line 146 of file file.py.

References open(), and path.

Referenced by open(), pscfpp.file.Directory.write(), and write().

◆ write()

pscfpp.file.File.write ( self,
filename )

Write XML representation to a file.

Parameters
filenamename of output file

Reimplemented in pscfpp.file.Directory.

Definition at line 154 of file file.py.

References open(), and xml().

◆ __eq__()

pscfpp.file.File.__eq__ ( self,
other )

Test for equality of files.

This function returns true if this and other are equivalent.

Parameters
otherfile to which to compare this one.

Definition at line 166 of file file.py.

References path, Pscf::Prdc::Basis< D >::Star.size, and size.

◆ __ne__()

pscfpp.file.File.__ne__ ( self,
other )

Test for inequality of files.

This function returns true if this and other are in-equivalent.

Parameters
otherfile to which to compare this one.

Definition at line 179 of file file.py.


The documentation for this class was generated from the following file: