company logo

File :: copy - Copy file or directory

The function copies a single file or directory. When the current file location is a directory, all files in the directory are copied.

Implementation overview

Implementation details

  1. Copy single file
    File  :: copy ( odaba::String &sPath )

    The function copies the file or directory to the location passed in sPath. The function allows copying single files, all files in a directory or directories and all its subordinated directories and files.

    When copyinf a directory, the target location passed in sPath must not be a file. When the target location does not exist, a corresponding directory will be created.

    • sPath - File path
  2. to list
  3. Copy directories recursive
    File  :: copy ( odaba::String &sPath, bool bRecursive )

    The function allows copying directories recursive, i.e. all sub-directories and its files may be copied. The current file location must be a directory and the target location passed in sPath must not be a file. When the target location does not exist, a corresponding directory will be created.

    Recursive copy is done when by passing true in bRecursive.

    • sPath - File path
    • bRecursive - Process recursive

      The function is called recursively for subordinated elements.

  4. to list