GFS_MKDIR(3)

✨ GFS_MKDIR(3) ✨

okay bestie, gather round, because this is the Gfarm manual page for gfs_mkdir, section 3 of the library calls πŸ’… she's a libc-flavored girlie, not a command-line one, so she lives in your code, not your shell.


🌸 NAME 🌸

gfs_mkdir β€” bestie, she makes a directory. that's it. that's the whole job. iconic behavior, no notes πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gfarm/gfarm.h>

gfarm_error_t gfs_mkdir(const char * gfarm_url, gfarm_mode_t mode);

like. look at her. two args. one job. main character energy fr fr ✨


πŸ’– DESCRIPTION πŸ’–

so gfs_mkdir() attempts to create a directory named gfarm_url. that's the vibe. that's the assignment. she ate and left no crumbs πŸ“

and mode? that's where you tell her the permissions to use. lowkey important: it gets modified by the process's umask in the usual way β€” the permissions of the created file end up being (mode & ~umask). no cap, that's just how it goes πŸ’…

not me reminding you that umask is silently editing your whole permission situation behind your back πŸ™ˆ she's not doing anything wrong, she's just following the rules.

πŸ”₯ RETURN VALUES πŸ”₯

okay so here's the vibe check on what she hands back to you:

  • GFARM_ERR_NO_ERROR β€” she did it!! the function terminated successfully, we love a win πŸ‘‘
  • GFARM_ERR_NO_MEMORY β€” insufficient memory was available 😭 girl is running on fumes, there was just not enough memory to go around.
  • GFARM_ERR_ALREADY_EXISTS β€” gfarm_url already exists. and bestie, that does not necessarily mean it's a directory. this includes the case where gfarm_url is a symbolic link, dangling or not. so like, it's taken. the name is taken. move on πŸ’€
  • GFARM_ERR_NO_SUCH_OBJECT β€” the parent directory of gfarm_url does not exist. you can't put a folder inside a folder that isn't there, that's just math 🧚
  • GFARM_ERR_NOT_A_DIRECTORY β€” a component of the path prefix is not a directory. something along the way is cosplaying as a folder and it is NOT one πŸ™ˆ
  • Others β€” an error except the above occurred. the reason is shown by gfarm_error_string(3), so go ask her, she'll explain ✨

and that's the whole page bestie!! this one came from the Gfarm girlies, dated 23 Jun 2019, and it's filed under section 3 πŸŽ€ go forth and make directories responsibly, mwah πŸ’–πŸ¦‹πŸŒΈ