Unix System Programming

Assignments

  1. mycp.cc -> replicates cp command
  2. cpcmd.c -> replicates cp command
  3. mvcmd.c -> replicates mv command
  4. catcmd.c -> replicates cat command
  5. lncmd.c -> replicates ln command
  6. filetype.cc -> Displays the type of a file
  7. filepermissions.cc -> Displays the permissions given to a file
  8. userandgroup.cc -> Tells which user and group a file belongs to
  9. linkcounter.cc -> Tells the number of links to the file
  10. quarantinewriter.cc, bytereader.cc, filereader.cc -> All show read and write api functioning
  11. dircreator.cc -> Create a directory and lists all the files in directory
  12. lockcheck.cc ->C++ program to check whether the region is locked or not. If the region is locked, print the PID of the print the pid of the process that is locked. If not locked, lock the region with an exclusive lock, read the last 10 bytes and unlock the region.
  13. FIFOcreate.cc -> Creates FIFO files
  14. readFIFO.cc -> Reads FIFO files
  15. writeFIFO.cc -> Writes FIFO files
  16. symlinkpath.cc -> Creates symbolic link and find the path of original file
  17. symlinkcontent.c -> Create symbolic link and reads content from the link
  18. readDir.c -> illustrates readdir api
  19. makeDir.c -> illustrates mkdir api
  20. rewindDir.c -> illustrates rewinddir api
  21. childandparent.c -> shows how to create parent and child processes
  22. circleandsquare.c -> shows how to achieve different tasks using child and parent processes
  23. zombie.c -> creates a zombie process
  24. orphan.c -> illustrates how to create orphan process
  25. race.c -> illustrates race condition

To run the files use the following in the terminal

	gcc filename.c -o filename
	./filename [arguments]   //For cc files use g++ instead of gcc