Zen API

- Home
- Help Topics
- Types by Category
- All Types
- Files

All Classes Files Functions Variables Typedefs Macros Groups Pages
Public Member Functions
kDirectory Class Reference
kApi/Io

## Description

Collection of directory-related functions.

## Public Member Functions
kStatus | kDirectory_AppConfig (const kChar *appName, kChar *directory, kSize capacity)
| Gets the directory from which an application should load its configuration/resource files. More...
kStatus | kDirectory_AppData (const kChar *appName, kChar *directory, kSize capacity)
| Gets a directory suitable for an application to write data files. More...
kStatus | kDirectory_Application (kChar *directory, kSize capacity)
| Gets the directory in which the application executable file resides. More...
kStatus | kDirectory_Copy (const kChar *source, const kChar *destination)
| Copies the specified directory, including all of its contents. More...
kStatus | kDirectory_Create (const kChar *directory)
| Creates a directory at the specified location. More...
kStatus | kDirectory_Current (kChar *directory, kSize capacity)
| Gets the current working directory. More...
kStatus | kDirectory_Delete (const kChar *directory)
| Deletes the specified directory, including all of its contents. More...
kBool | kDirectory_Exists (const kChar *directory)
| Reports whether the specified directory exists. More...
kStatus | kDirectory_ListDirectories (const kChar *directory, kArrayList directories)
| Creates a list of the sub-directories in the specified directory. More...
kStatus | kDirectory_ListEntries (const kChar *directory, kArrayList entries)
| Creates a list of the file system entries in the specified directory. More...
kStatus | kDirectory_ListFiles (const kChar *directory, kArrayList files)
| List the files in the specified directory. More...
kStatus | kDirectory_Move (const kChar *source, const kChar *destination)
| Moves the specified directory, including all of its contents. More...
kStatus | kDirectory_Plugin (kChar *directory, kSize capacity)
| Gets the directory where plug-ins are located. More...
kStatus | kDirectory_SetCurrent (const kChar *directory)
| Sets the current working directory. More...
kStatus | kDirectory_Temp (kChar *directory, kSize capacity)
| Gets the path of a directory suitable for temporary files. More...

## Member Function Documentation

kStatus kDirectory_AppConfig | ( | const kChar * | appName,
|  | kChar * | directory,
|  | kSize | capacity
| ) |  |

Gets the directory from which an application should load its configuration/resource files.

This function assumes the standard folder organization of a kApi-based application.

Parameters

  appName | The name of the application (optional).
  directory | Returns the full path of the requested directory.
  capacity | Maximum number of characters (including null terminator).

Returns
  Operation status.

kStatus kDirectory_AppData | ( | const kChar * | appName,
|  | kChar * | directory,
|  | kSize | capacity
| ) |  |

Gets a directory suitable for an application to write data files.

This function assumes the standard folder organization of a kApi-based application.

Parameters

  appName | The name of the application (optional).
  directory | Returns the full path of the requested directory.
  capacity | Maximum number of characters (including null terminator).

Returns
  Operation status.

kStatus kDirectory_Application | ( | kChar * | directory,
|  | kSize | capacity
| ) |  |

Gets the directory in which the application executable file resides.

Parameters

  directory | Returns the full path of the application directory.
  capacity | Maximum number of characters (including null terminator).

Returns
  Operation status.

kStatus kDirectory_Copy | ( | const kChar * | source,
|  | const kChar * | destination
| ) |  |

Copies the specified directory, including all of its contents.

This function is only supported on Windows at this time.

Parameters

  source | Full path of the source directory.
  destination | Full path of the destination directory.

Returns
  Operation status.

kStatus kDirectory_Create | ( | const kChar * | directory | ) |

Creates a directory at the specified location.

This function will fail if the directory already exists. Missing parent folders will be created automatically.

This function is only supported on Windows at this time.

Parameters

  directory | Full path of the directory.

Returns
  Operation status.

kStatus kDirectory_Current | ( | kChar * | directory,
|  | kSize | capacity
| ) |  |

Gets the current working directory.

Parameters

  directory | Returns the full path of the current working directory.
  capacity | Maximum number of characters (including null terminator).

Returns
  Operation status.

kStatus kDirectory_Delete | ( | const kChar * | directory | ) |

Deletes the specified directory, including all of its contents.

This function is only supported on Windows at this time.

Parameters

  directory | Full path of the directory.

Returns
  Operation status.

kBool kDirectory_Exists | ( | const kChar * | directory | ) |

Reports whether the specified directory exists.

This function is only supported on Windows at this time.

Parameters

  directory | Full path of the directory.

Returns
  kTRUE if the directory exists, kFALSE otherwise.

kStatus kDirectory_ListDirectories | ( | const kChar * | directory,
|  | kArrayList | directories
| ) |  |

Creates a list of the sub-directories in the specified directory.

Use kArrayList_Purge to destroy the directory names returned by this function.

Parameters

  directory | Full path of the directory.
  directories | Receives directory names (kArrayList<kString>).

Returns
  Operation status.

kStatus kDirectory_ListEntries | ( | const kChar * | directory,
|  | kArrayList | entries
| ) |  |

Creates a list of the file system entries in the specified directory.

Use kArrayList_Purge to destroy the entry names returned by this function.

Parameters

  directory | Full path of the directory.
  entries | Receives entry names (kArrayList<kString>).

Returns
  Operation status.

kStatus kDirectory_ListFiles | ( | const kChar * | directory,
|  | kArrayList | files
| ) |  |

List the files in the specified directory.

Use kArrayList_Purge to destroy the file names returned by this function.

Parameters

  directory | Full path of the directory.
  files | Receives file names (kArrayList<kString>).

Returns
  Operation status.

kStatus kDirectory_Move | ( | const kChar * | source,
|  | const kChar * | destination
| ) |  |

Moves the specified directory, including all of its contents.

This function is only supported on Windows at this time.

Parameters

  source | Full path of the source directory.
  destination | Full path of the destination directory.

Returns
  Operation status.

kStatus kDirectory_Plugin | ( | kChar * | directory,
|  | kSize | capacity
| ) |  |

Gets the directory where plug-ins are located.

This function assumes the standard folder organization of a kApi-based application.

Parameters

  directory | Returns the full path of the requested directory.
  capacity | Maximum number of characters (including null terminator).

Returns
  Operation status.

kStatus kDirectory_SetCurrent | ( | const kChar * | directory | ) |

Sets the current working directory.

Parameters

  directory | Full path of the desired working directory.

Returns
  Operation status.

kStatus kDirectory_Temp | ( | kChar * | directory,
|  | kSize | capacity
| ) |  |

Gets the path of a directory suitable for temporary files.

Parameters

  directory | Returns the full path of the temp directory.
  capacity | Maximum number of characters (including null terminator).

Returns
  Operation status.

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

- Io/kDirectory.h