Coder Social home page Coder Social logo

ryanmohamed / file-statistics-ipc-posix-c Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 65 KB

File statistics program written using some low level operating systems methodologies in C.

C 100.00%
c ipc linux low-level message-queue multiprocessing operating-systems posix

file-statistics-ipc-posix-c's Introduction

File Statistics with Interprocess Communication in C

This program calculates various statistics for text files, including newline count, word count, character count, and maximum line length.

Usage

To use the program, follow these steps:

  1. Compile the program using a C compiler:

    gcc PosixMessageQueue.c -o file_stats
  2. Run the program with the following command-line flags:

    ./file_stats [OPTIONS] [FILES]

    Replace [OPTIONS] with one or more of the following flags to specify the statistics to calculate:

    • -l: Calculate newline count.
    • -w: Calculate word count.
    • -c: Calculate character count.
    • -L: Calculate maximum line length.
  3. The program will display the requested statistics for each file.

Example

To calculate the newline count and word count for a file named "input.txt", run the following command:

./file_stats -l -w input.txt

The program will output the newline count and word count for the specified file.

Notes

  • The program supports processing multiple files simultaneously. Simply provide the file names as separate arguments.
  • If no file names are provided, the program will use a default file.
  • The program uses message queues for inter-process communication between the parent and child processes.
  • The program relies on the POSIX message queue API and may require a POSIX-compliant operating system.

file-statistics-ipc-posix-c's People

Contributors

ryanmohamed avatar

Stargazers

 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.