/* Create-if-absent for remotes that have no hard links. * * The folder backend publishes by hard-linking a temp file into place, which * fails when the name is taken. exFAT, FAT and many SMB shares have no hard * links at all, so there `link` fails even on an absent name and every put * looks like a collision. O_CREAT|O_EXCL is the same test — the kernel creates * the name or reports it taken — and works on those filesystems. */ #ifndef KOH_CREATE_H #define KOH_CREATE_H #include /* Creates `path` with `data`. Returns 1 when created, 0 when the name already * exists, -1 on any other error (nothing is left behind in that case). */ int koh_create_exclusive(const char *path, const void *data, size_t len); #endif