|
Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
|
Directory is the directory of the file systems for routers and switches. More...
Public Member Functions | |
| int | getFileCount () |
| Returns the number of files in the file system. More... | |
| File | getFileAt (int) |
| Returns the file at the specified index. More... | |
| File | getFile (string) |
| Returns the file with the specified filename. More... | |
| bool | fileExist (string) |
| Returns if a file exist in the file system. More... | |
| int | getSpaceUsed () |
| Returns the amount of space used on this file system. More... | |
| bool | addFile (File, bool) |
| Add file into filesystem. More... | |
| bool | addTextFile (string, string, bool) |
| Add text file into filesystem. More... | |
| bool | addDirectory (string, bool) |
| Add directory into filesystem. More... | |
| bool | addHttpPage (string, string, bool) |
| Returns true if the HTTP page was added successfully, false otherwise. More... | |
| bool | copyAllFilesFrom (Directory, bool) |
| Copy all files from another directory. More... | |
| bool | removeFile (string, bool) |
| Returns true if the file was removed successfully, false otherwise. More... | |
| bool | removeAllFiles (bool) |
| Returns true if all files were removed successfully, false otherwise. More... | |
| bool | renameFile (string, string, bool) |
| Returns true if the file was renamed successfully, false otherwise. More... | |
| void | fileAdded (string) |
| This event is emitted when a file is added successfully. More... | |
| void | fileRemoved (string) |
| This event is emitted when a file is removed successfully. More... | |
| void | fileRenamed (string, string) |
| This event is emitted when a file name is changed successfully. More... | |
Public Member Functions inherited from File | |
| string | getName () |
| Returns the filename of the file. More... | |
| FilePermission | getPermission () |
| Returns the permissions of the file. More... | |
| bool | isExecutable () |
| Returns true if the file is executable, otherwise false. More... | |
| bool | isWritable () |
| Returns true if the file is writable, otherwise false. More... | |
| bool | isReadable () |
| Returns true if the file is readable, otherwise false. More... | |
| bool | isDirectory () |
| Returns true if the file is a directory, otherwise false. More... | |
| int | getSize () |
| Returns the filesize of the file. More... | |
| Directory | getParent () |
| Returns the parent directory. More... | |
| string | getAbsPath () |
| Returns absolute path of the File object. More... | |
| void | setTextContent (string, bool) |
| set the content of the File object. More... | |
| FileContent | getContent (bool) |
| Returns the file content of the File. More... | |
Directory is the directory of the file systems for routers and switches.
| bool Directory::addDirectory | ( | string | , |
| bool | |||
| ) |
Add directory into filesystem.
| name,Directory | name |
| bCheckPermission,true | if write permission needs to be checked and false if otherwise |
| bool Directory::addFile | ( | File | , |
| bool | |||
| ) |
Add file into filesystem.
| file,File | object of the file to check |
| bCheckPermission,true | if write permission needs to be checked and false if otherwise |
| bool Directory::addHttpPage | ( | string | , |
| string | , | ||
| bool | |||
| ) |
Returns true if the HTTP page was added successfully, false otherwise.
| name,the | name of the HTTP page. |
| content,the | content of the HTTP page. |
| bCheckPermission,true | to check permissions, false to skip. |
| bool Directory::addTextFile | ( | string | , |
| string | , | ||
| bool | |||
| ) |
Add text file into filesystem.
| name,File | name |
| content,file | content |
| bCheckPermission,true | if write permission needs to be checked and false if otherwise |
| bool Directory::copyAllFilesFrom | ( | Directory | , |
| bool | |||
| ) |
Copy all files from another directory.
| dir,the | directory object to copy files from |
| bCheckPermission,true | if write permission needs to be checked and false if otherwise |
| void Directory::fileAdded | ( | string | ) |
This event is emitted when a file is added successfully.
| fileName,the | file name of the file that was added |
IPC event.
| bool Directory::fileExist | ( | string | ) |
Returns if a file exist in the file system.
| name,file | name |
| void Directory::fileRemoved | ( | string | ) |
This event is emitted when a file is removed successfully.
| fileName,the | file name of the file that was removed |
IPC event.
| void Directory::fileRenamed | ( | string | , |
| string | |||
| ) |
This event is emitted when a file name is changed successfully.
| oldFileName,the | old file name of the file |
| newFileName,the | new file name of the file |
IPC event.
| File Directory::getFile | ( | string | ) |
| File Directory::getFileAt | ( | int | ) |
| int Directory::getFileCount | ( | ) |
Returns the number of files in the file system.
| int Directory::getSpaceUsed | ( | ) |
Returns the amount of space used on this file system.
| bool Directory::removeAllFiles | ( | bool | ) |
Returns true if all files were removed successfully, false otherwise.
| bCheckPermission,true | to check permissions, false to skip. |
| bool Directory::removeFile | ( | string | , |
| bool | |||
| ) |
Returns true if the file was removed successfully, false otherwise.
| name,the | name of the file of interest. |
| bCheckPermission,true | to check permissions, false to skip. |
| bool Directory::renameFile | ( | string | , |
| string | , | ||
| bool | |||
| ) |
Returns true if the file was renamed successfully, false otherwise.
| oldName,the | old file name |
| newName,the | new file name. |
| bCheckPermission,true | to check permissions, false to skip. |