https://github.com/codelixir/syscalls
Using system calls in C code to read/write to files/stdout/stderr. For OSN course, Monsoon 2021.
https://github.com/codelixir/syscalls
c system-calls
Last synced: 3 months ago
JSON representation
Using system calls in C code to read/write to files/stdout/stderr. For OSN course, Monsoon 2021.
- Host: GitHub
- URL: https://github.com/codelixir/syscalls
- Owner: codelixir
- Created: 2021-08-27T10:29:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-12T07:15:19.000Z (almost 4 years ago)
- Last Synced: 2025-02-08T00:19:14.795Z (5 months ago)
- Topics: c, system-calls
- Language: C
- Homepage:
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://forthebadge.com)
# System Calls
The problem statements are given in [Assignment.pdf](Assignment.pdf).
Some sample files are given in `sample` directory with [`test.txt`](sample/test.txt) as the input. The outputs are generated using:
```bash
$ gcc q1.c
$ ./a.out test.txt
```
```bash
$ gcc q2.c
$ ./a.out test.txt 6 3
```
```bash
$ gcc q1.c
$ ./a.out test.txt > 3.txt
```## Assumptions and Remarks
### Question 1
* In case of missing arguments, program exits. In case of additional arguments, program continues by ignoring extra arguments. In both cases, error messages are output to the terminal.
* If the directory `Assignment/` already exists, permissions aren't being overridden because the assignment mentioned to use the existing directory. Same for files; content is being overridden, permissions aren't.### Question 2
* Same as question 1
* Last 2 arguments are single digit positive integers. (Throws error for non-integers and negative integers).
* The file is exactly divisible into the input number of parts### Question 3
* Same as Q1 Point 1
* `Assignment/` directory, if exists, is present inside the working directory.---
*These codes were written as a part of the Operating Systems and Networks course, Monsoon 2021.*