
- Walter Becker and Donald Fagen
File
File Methods
Derived Classes
None
See Also
public method File(string Name)
Parameters
Name
Full name of the file
Return Value
None
Description
Constructor for the File class. The full name of the file is passed in (including drive and path). If a local/relative name is passed in, the default directory will be prepended. The default directory is the directory where the Aztec program was loaded from, but can also be changed using the "Script.SetDefaultFolder()" method.
File Class
public virtual method<bool> Exists()
Parameters
None
Return Value
True if the item exists
Description
Virtual method to determine existence of the file. If the file exists, it returns true, and if the file does not exist, it returns false.
File Class
public virtual method<int> Rename(string NewName)
Parameters
NewName
New name for the file
Return Value
Returns 0 if successful
Description
This virtual method renames the file. The new name can either be a local name or a full name (including path). If a local name is provided, the entry is renamed within the same directory. If a full name is provided, the file is renamed and possibly moved to another directory. If successful, the method returns a value of zero.
File Class
public virtual method<int> Delete()
Parameters
None
Return Value
Returns 0 if successful
Description
This virtual method deletes the actual file referenced by this File object. If successful, the method returns a value of zero.
File Class
public method<int> Size()
Parameters
None
Return Value
Returns size of file
Description
This method returns the size of the actual file in bytes. If the file doesn't actually exist, this method will return 0.
File Class
public method<int> Copy(string NewLocation)
Parameters
NewLocation
File name or directory the contents will be copied to
Return Value
Returns 0 if successful
Description
This method copies the entire contents of the file referenced by this File object to the new file location specified by NewLocation. If the name is a local name (no directory back slashes), the file is copied within the same directory. If the name is a full name, it is copied to that location. If the "NewLocation" is a directory/folder instead of a file, then a new file will be created in the specified directory with the same name as the source file and the contents will be copied to that new file.
The method returns zero if successful, and a non-zero error indicator if not.
File Class