Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

When the demon is at your door...

In the morning it won't be there... no more.

- Walter Becker and Donald Fagen

 

aztec.file.File

public class File from<DirectoryEntry>

Base

FolderEntry

File

The File class represents a file entry in an OS file system. It is derived from the FolderEntry class, and it provides access to a single file for manipulation (rename, copy, delete) and information (size, modification date, etc.). This class can also be used as an input to a variety of other methods throughout the framework whenever a filename is needed.

File Methods

File() Constructor for the File class
Exists() Method to determine existence of the file
Rename() Method to rename the file
Delete() Method to delete the file
Size() Returns the size of the actual file in bytes
Copy() Copies the actual contents of the file to another file

Derived Classes

See Also

 


File()

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


Exists()

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


Rename()

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


Delete()

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


Size()

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


Copy()

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

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec