Git Product home page Git Product logo

system-calls's Introduction

Introduction to system calls

Task 1

Given a file, you need to reverse the contents of the file and store the result in a new file in the directory named “Assignment”. The percentage of the file written should be printed on the console during file writing. The percentage of the file written should be overwritten each time (shouldn’t write multiple times). The directory created should have read, write, and execute permissions for the user who created it. The new file created should have the read and write permissions for the user who created it. The program will be tested on LARGE (>1GB) files which could be greater than RAM size.

The input file path would be given to you as an argument to your program: ./a.out < input file path >

The output file must be named: 1 < input file name >

Task 2

Write a program to reverse a specific portion of the file and store the result in a new file in the directory named “Assignment”. The percentage of the file written should be printed on the console during file writing. The percentage of the file written should be overwritten each time (shouldn’t write multiple times). The directory created should have read, write, and execute permissions for the user who created it. The new file created should have the read and write permissions for the user who created it. The program will be tested on LARGE (>1GB) files which could be greater than RAM size.

The input file path would be given to you as an argument to your program along with the start and stop character, reverse the rest of the file and leave the portion of the file from the start character to the stop character untouched. In order to do this you will have to reverse the file in two parts, from 0 to the start character and from the end character to the end of the document. Assume the first character of the document to be 0:

The input file path would be given to you as an argument to your program: ./a.out < input file path > start_char end_char

The output file must be named: 2 < input file name >

Task 3

  1. Check the permissions for the two files and the directory.
  2. Check whether the content in the new file are the reverse of the old file.

The input to this program has paths for newfile, oldfile, and the directory. Example: Directory is created: Yes Whether file contents are reversed in newfile: Yes User has read permissions on newfile: Yes User has write permission on newfile: Yes User has execute permission on newfile: No Group has read permissions on newfile: No Group has write permission on newfile: No Group has execute permission on newfile: No Others has read permissions on newfile: No Others has write permission on newfile: No Others has execute permission on newfile: No

The above 9 should be printed for the old file and the directory too. Path of newfile oldfile and directory will be passed as a command-line argument: ./a.out < newfile >< oldfile >< directory >

system-calls's People

Contributors

sidjain-12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.