Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5da4517

Browse files
author
Safa Bayar
committed
Added new study
1 parent 2b1b2b0 commit 5da4517

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

‎Sonradan Yaptiklarim/ders5-1.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
#include <sys/types.h>
3+
#include <sys/stat.h>
4+
#include <fcntl.h>
5+
#include <unistd.h>
6+
7+
int main(){
8+
9+
char buf[4096];
10+
11+
int fd = open("safa.txt1",O_WRONLY | O_CREAT | O_TRUNC,0644
12+
sprintf(buf,"Merhaba secim aksami");
13+
write(fd,buf,t);
14+
close(fd);
15+
16+
return 0;
17+
}

‎Sonradan Yaptiklarim/ders5-1/a.out

8.74 KB
Binary file not shown.

‎Sonradan Yaptiklarim/ders5-1/ders5-1.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <stdio.h>
2+
#include <sys/types.h>
3+
#include <sys/stat.h>
4+
#include <fcntl.h>
5+
#include <unistd.h>
6+
7+
int main(){
8+
umask(0);
9+
char buf[4096];
10+
11+
int fd = open("safa.txt1", O_APPEND | O_RDWR, 0644);
12+
int psid = getpid();
13+
int t = sprintf(buf,"Merhaba secim aksami %d \n",psid);
14+
//fchmod(fd,0444);
15+
fchown(fd,0,0);
16+
write(fd,buf,t);
17+
close(fd);
18+
19+
return 0;
20+
}

‎Sonradan Yaptiklarim/ders5-1/ders5-1.c~

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
#include <sys/types.h>
3+
#include <sys/stat.h>
4+
#include <fcntl.h>
5+
#include <unistd.h>
6+
7+
int main(){
8+
9+
char buf[4096];
10+
11+
int fd = open("safa.txt", O_CREAT, O_RDWR);
12+
int t = sprintf(buf,"Merhaba secim aksami");
13+
write(fd,buf,42);
14+
close(fd);
15+
16+
return 0;
17+
}

‎Sonradan Yaptiklarim/ders5-1/safa.txt1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Merhaba secim aksami 1520Merhaba secim aksami 1537Merhaba secim aksami 1552
2+
Merhaba secim aksami 2192

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /