Skip to content

Split "fileExists" into "fileExists" and "directoryExists" #1124

@madoar

Description

@madoar

Currently we provide a single method fileExists which checks whether a given file path exists. This method can be used to check both if a file and if a directory exists. In case the method is used to check whether a directory exists it looks out of place, for example:

if (!fileExists(fontDirectory)) {
   mkdir(fontDirectory);
}

To improve this we should split the current fileExists method into a fileExists and a directoryExists method, which should be disjunct (exclude each other). More specific if a directory path is passed to fileExists and if a file is passed to directoryExists the methods should throw an error.

For more details see also #1116 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions