Core Foundation

kuniga.me > Docs > Core Foundation

Core Foundation

Filesystem

Creates a file or directory.

CFURLRef CFURLCreateWithFileSystemPath(
    CFAllocatorRef allocator,
    CFStringRef filePath,
    CFURLPathStyle pathStyle,
    Boolean isDirectory);

Example: Creating a file from a relative path foo.txt:

CFURLRef CFURLCreateWithFileSystemPath(
    kCFAllocatorDefault,
    CFSTR("./foo.txt"),
    kCFURLPOSIXPathStyle,
    false);