forked from flaneur2020/fleurix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0556fa
commit aea3d65
Showing
27 changed files
with
184 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
When life leaves us blind | ||
Love keeps us kind | ||
When Life leaves us blind | ||
Love keeps us kind | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
god saves us everyone when we are burning in the fire of a thousand suns. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
// | ||
#include <super.h> | ||
#include <inode.h> | ||
#include <dirent.h> | ||
#include <file.h> | ||
#include <stat.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef DIRENT_H | ||
#define DIRENT_H | ||
|
||
/* directory entry */ | ||
#define NAMELEN 12 | ||
|
||
struct dirent { | ||
ushort d_ino; | ||
char d_name[NAMELEN]; | ||
char __p[18]; /* a padding. each dirent is aligned with a 32 bytes boundary. */ | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <param.h> | ||
#include <file.h> | ||
#include <stat.h> | ||
#include <unistd.h> | ||
#include <dirent.h> | ||
|
||
int cat(char *pathp){ | ||
int fd; | ||
char buf[32]; | ||
|
||
fd = open(pathp, "r", 0); | ||
if (fd < 0) | ||
return -1; | ||
|
||
while(read(fd, buf, 32)>0){ | ||
printf("%s", buf); | ||
memset(buf, 0, 32); | ||
|
||
} | ||
write(0, "", 0); | ||
close(fd); | ||
} | ||
|
||
int main(int argc, char **argv){ | ||
int i = 0; | ||
|
||
if (argc>1) { | ||
for(i=1; i<argc; i++) | ||
cat(argv[i]); | ||
} | ||
printf("\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <param.h> | ||
#include <file.h> | ||
#include <stat.h> | ||
#include <unistd.h> | ||
#include <dirent.h> | ||
|
||
int ls(char *pathp){ | ||
struct stat sbuf; | ||
struct dirent dbuf; | ||
char pathbuf[1024]; | ||
int fd, r; | ||
|
||
if (pathp==NULL) | ||
strcpy(pathbuf, "."); | ||
else | ||
strncpy(pathbuf, pathp, 1024); | ||
// | ||
fd = open(pathbuf, O_RDONLY, 0); | ||
if (fd<0) { | ||
return -1; | ||
} | ||
fstat(fd, &sbuf); | ||
if (!S_ISDIR(sbuf.st_mode)){ | ||
return -1; | ||
} | ||
|
||
while((r=read(fd, &dbuf, sizeof(struct dirent)))>0) | ||
printf("%s\t", dbuf.d_name); | ||
} | ||
|
||
int main(int argc, char **argv){ | ||
int i = 0; | ||
|
||
if (argc==1) | ||
ls(NULL); | ||
else{ | ||
for(i=1; i<argc; i++) | ||
ls(argv[i]); | ||
} | ||
printf("\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <param.h> | ||
#include <file.h> | ||
#include <unistd.h> | ||
|
||
int a=3; | ||
|
||
int main(int argc, char **argv) { | ||
int fd; | ||
|
||
printf("open about.txt: %d\n", open("about.txt", O_RDWR, 0)); | ||
chdir("home"); | ||
printf("cd home\n"); | ||
printf("open about.txt: %d\n", open("about.txt", O_RDWR, 0)); | ||
chdir("."); | ||
printf(".\n"); | ||
printf("open about.txt: %d\n", open("about.txt", O_RDWR, 0)); | ||
return 0; | ||
} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.