Skip to content

Instantly share code, notes, and snippets.

View cho0h5's full-sized avatar
🤯

Youngho Cho cho0h5

🤯
  • Chung-Ang University
  • Korea
  • 10:05 (UTC +09:00)
View GitHub Profile
@cho0h5
cho0h5 / file_read.c
Last active December 18, 2021 04:02
c file io
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int main() {
int fd = open("foo.txt", O_RDWR | O_CREAT, 0644);
if(fd < 0) {
printf("failed\n");
return -1;