Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lab3 : implementing ls command
- system calls:
- -mkdir
- -opendir
- -readdir
- -rmdir
- -closedir
- -getcwd
- aim: print pwd
- pwd.c
- #include<stdio.h>
- #include<stdlib.h>
- #include<unistd.h>
- #define BUFF 1024
- int main()
- {
- char buf[BUFF];
- if(getcwd(buf,sizeof(buf))!=NULL)
- {
- printf("%s\n",buf);
- }
- else
- {
- printf("Error.");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment