Programs related to system programming //All inputs are through command line arguments
//open(),close(),read(),write()
--Assignment 1
- Write a program which is used to add two numbers.
- Write a program which accept name from command line argument and display it on screen.
- Write a program which is used to display “Hello World” on screen and create its executable file.
- Create makefile for above application and execute it using makefile.
- Write a program which accept file name from user and open that file.
- Write a program which accept file name from user and open that file and if file is not opened properly then display error message properly.
- Write a program which accept file name and read first 5 characters from it.
- Write a program which accept file name from user and read whole file.
- Write a program which accept filename and string from user and write that string into file
//File Info(stat)
--Assignment 2
- Write a program which accept file name from user and open that file.
- Write a program which accept file name and mode from user and then open that file in specified mode.
- Write a program which accept file name and on mode and that program check whether our process can access that file in accepted mode or not.
- Write a program which accept file name from user and print all information about that file.
- Write a program which accept file name and number of bytes from user and read that number of bytes from file.
- Write a program which accept file name from user and read whole file.
- Write a program which accept file name from user and write string in that file.
//directory(dirent),opendir(),readdir(),closedir()
--Assignment 3
- Write a program which accept directory name from user and print all file names from that directory.
- Write a program which accept directory name from user and print all file names and its types from that directory.
- Write a program which accept directory name from user and print name of such a file having largest size.
- Write a program which accept two file names from user and copy the contents of an existing file into newly created file.
- Write a program which accept directory name and file name from user and check whether that file is present in that directory or not.
- Write a program which accept two directory names from user and move all files from source directory to destination directory.
- Write program which accept directory name from user and delete all empty files from that directory.