Spec-Zone.ru › ColdFusion

directoryExists

Determines whether an on-disk or in-memory directory exists.

directoryExists(path) → returns boolean

  • CF4+
  • Lucee
  • BL 1.0.0+
  • See Also: directoryCreate directoryDelete fileExists

    Argument Reference

    path string
    Required

    An absolute on-disk or in-memory path. Alternatively, you can specify IP address as in the following example: DirectoryExists("//12.3.123.123/c_drive/test");

    allowRealPath boolean

    Lucee Only. boolean that defines if relative paths are interpreted or not.

    Examples
    Sample code invoking the directoryExists 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/directoryexists

    Spec-Zone.ru

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