Skip to content

Instantly share code, notes, and snippets.

@zguangyu
Last active August 29, 2015 14:04
Show Gist options
  • Save zguangyu/9ec4fe8508a17ca0192d to your computer and use it in GitHub Desktop.
Save zguangyu/9ec4fe8508a17ca0192d to your computer and use it in GitHub Desktop.
create a dir and create a file in it
#include <linux/stat.h>
#include <linux/types.h>
#include <fcntl.h>
int main()
{
mkdir("foo", 0755);
int a = open("foo/bar", O_RDWR | O_CREAT, 0644);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment