Spec-Zone.ru › ColdFusion

directoryCreate

Creates an on-disk or in-memory directory in the specified path

directoryCreate(path) → returns void

  • CF9+
  • Lucee
  • BL 1.0.0+
  • See Also: fileWrite directoryDelete directoryExists directoryRename

    Argument Reference

    path string
    Required

    Absolute path of the directory to be created. Alternatively, you can specify an IP address, as in the following example: DirectoryCreate("//12.3.123.123/c_drive/test". NOTE: You have to have the required permissions to run this function.);

    createPath boolean
    Default: true

    Lucee Only. Create parent directory when it doesn't exist.

    ignoreExists boolean
    Default: false

    Lucee Only. Pass false (default) to throw an error if the directory already exists, or true to skip the create operation without an error.

    Examples
    Sample code invoking the directoryCreate function

    Script Syntax

    Checking if a directory called 'icons' exists and then creating the directory if it does not exist.

    if (!directoryExists(expandPath('/assets/img/icons'))) {
    	directoryCreate('assets/img/icons');
    }

    Expected Result: The directory 'icons' will be created under the img folder.

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/directorycreate

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API