inodeMimeType

Get inode mime type for file path.

  1. string inodeMimeType(mode_t mode)
  2. string inodeMimeType(const(char)[] filePath)
    @trusted nothrow
    string
    inodeMimeType
    (
    scope const(char)[] filePath
    )

Return Value

Type: string

inode/* mime type name for stated path or null if type is unknown or filePath targets regular file. Note: On non-posix platforms it only cheks if filePath targets directory and returns inode/directory if so.

Examples

assert(inodeMimeType("source") == "inode/directory"); //directory
assert(inodeMimeType("dub.json") is null); //regular file
assert(inodeMimeType("test/|nonexistent|") is null); //nonexistent path

Meta