/Linux-System-Programming

Programs related to system programming

Primary LanguageC

Linux-System-Programming

Programs related to system programming //All inputs are through command line arguments

Basic File System Calls

//open(),close(),read(),write()

--Assignment 1

  1. Write a program which is used to add two numbers.
  2. Write a program which accept name from command line argument and display it on screen.
  3. Write a program which is used to display “Hello World” on screen and create its executable file.
  4. Create makefile for above application and execute it using makefile.
  5. Write a program which accept file name from user and open that file.
  6. 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.
  7. Write a program which accept file name and read first 5 characters from it.
  8. Write a program which accept file name from user and read whole file.
  9. Write a program which accept filename and string from user and write that string into file

//File Info(stat)

--Assignment 2

  1. Write a program which accept file name from user and open that file.
  2. Write a program which accept file name and mode from user and then open that file in specified mode.
  3. 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.
  4. Write a program which accept file name from user and print all information about that file.
  5. Write a program which accept file name and number of bytes from user and read that number of bytes from file.
  6. Write a program which accept file name from user and read whole file.
  7. Write a program which accept file name from user and write string in that file.

//directory(dirent),opendir(),readdir(),closedir()

--Assignment 3

  1. Write a program which accept directory name from user and print all file names from that directory.
  2. Write a program which accept directory name from user and print all file names and its types from that directory.
  3. Write a program which accept directory name from user and print name of such a file having largest size.
  4. Write a program which accept two file names from user and copy the contents of an existing file into newly created file.
  5. Write a program which accept directory name and file name from user and check whether that file is present in that directory or not.
  6. Write a program which accept two directory names from user and move all files from source directory to destination directory.
  7. Write program which accept directory name from user and delete all empty files from that directory.