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 59cf155

Browse files
author
Safa Bayar
committed
Added link and remove
1 parent d3a37ea commit 59cf155

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

‎Sonradan Yaptiklarim/ders5-1/a.out

120 Bytes
Binary file not shown.

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,29 @@ int main(){
88
umask(0);
99
char buf[4096];
1010

11-
int fd = open("safa.txt1", O_APPEND | O_RDWR, 0644);
11+
int fd = open("safa.txt1", O_CREAT | O_RDWR, 0644);
1212
int psid = getpid();
1313
int t = sprintf(buf,"Merhaba secim aksami %d \n",psid);
1414
//fchmod(fd,0444);
1515
fchown(fd,0,0);
16-
link("./safa.txt1","./olsa.txt");
16+
1717
write(fd,buf,t);
1818
close(fd);
19+
/* ### HARD LINK OLUSTURMAK ICIN ###
20+
if((link("./safa.txt1","./olsa.txt1")) == -1){
21+
printf("Hatali link olusturma");
22+
}
1923
24+
if(unlink("olsa.txt1") == -1){
25+
printf("Hatali link silme");
26+
}
27+
if(unlink("olsa.txt1") == -1){
28+
printf("Hatali link silme");
29+
}
30+
*/
31+
32+
/* ### DOSYA VEYA DIZIN SILMEK ICIN ###
33+
remove("./olsa.txt");
34+
*/
2035
return 0;
2136
}

‎Sonradan Yaptiklarim/ders5-1/olsa.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎Sonradan Yaptiklarim/ders5-1/safa.txt1

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

0 commit comments

Comments
(0)

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