-
Notifications
You must be signed in to change notification settings - Fork 1
/
check.c
41 lines (39 loc) · 766 Bytes
/
check.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "types.h"
#include "fcntl.h"
#include "user.h"
#include "stat.h"
#include "param.h"
#include "fs.h"
#include "syscall.h"
#include "traps.h"
#include "memlayout.h"
int
main(int argc, char *argv[])
{
int fd, fd1;
char c;
mkdir("utkarsh");
mkdir("mohanya");
fd = open("/utkarsh/1.txt", O_CREATE|O_RDWR);
fd1 = open("/utkarsh/2.txt", O_CREATE|O_RDWR);
c = 'a';
write(fd, &c, 1);
write(fd1, &c, 1);
c = 'a';
write(fd, &c, 1);
write(fd1, &c, 1);
c = 'a';
write(fd, &c, 1);
write(fd1, &c, 1);
c = 'a';
write(fd, &c, 1);
write(fd1, &c, 1);
c = 'a';
write(fd, &c, 1);
write(fd1, &c, 1);
c = '\n';
write(fd, &c, 1);
write(fd1, &c, 1);
close(fd);
close(fd1);
}