Dir Class
Dir Class
Members
static Dir ( ) #
Default constructor.static Dir ( string name ) #
Constructor. Creates a new directory instance.Arguments
- string name - Directory path to open.
getDirName ( int num ) #
Returns name of the directory with given index.Arguments
- int num - Directory index.
Return value
Name of the directory with num index.getFileMTime ( int num ) #
Returns the time of the file last modification.Arguments
- int num - File index.
Return value
Time of the last modification.getFileName ( int num ) #
Returns name of the file with given index.Arguments
- int num - File index.
Return value
Name of the file with num index.getFileSize ( int num ) #
Returns the size of the file with the given index.Arguments
- int num - File index.
Return value
File size.int setMTime ( string name, long value ) #
Sets the time of the last directory modification.Arguments
- string name - Directory name.
- long value - Time of the last modification.
Return value
1 if the time of the last directory modification was set successfully; otherwise, 0.long getMTime ( string name ) #
Returns the time of the last directory modification.Arguments
- string name - Directory name.
Return value
Time of the last modification.getName ( ) #
Returns the name of the current directory.Return value
Directory name.int getNumDirs ( ) #
Returns number of nested directories.Return value
Number of directories.int getNumFiles ( ) #
Returns number of files inside the directory.Return value
Number of files.int isFile ( string name ) #
Returns a value indicating if the specified file path exists.Arguments
- string name - File path to be checked.
Return value
1 if the specified file path exists; otherwise, 0.int isOpened ( ) #
Checks whether the directory is opened.Return value
1 if the directory is opened; otherwise, 0.getSize ( ) #
Returns the size of the current directory.Return value
Directory size.int close ( ) #
Closes the directory descriptor.Return value
int open ( ) #
Opens the directory.Arguments
Return value
Directory descriptor.int isAbsolute ( string name ) #
Returns a value indicating if the specified directory path is an absolute one.Arguments
- string name - Directory path.
Return value
1 if the specified directory path is an absolute one; otherwise, 0.int copy ( string name, string new_name ) #
Copies the specified file to a new destination path.Arguments
- string name - Source file path.
- string new_name - Destination file path.
Return value
1 if the specified file was successfully copied; otherwise, 0.int isDir ( string name ) #
Arguments
- string name
Last update:
2019-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)