Coder Social home page Coder Social logo

ft_ls-1's Introduction

ft_ls - @42Born2Code

My own implementation of the famous Unix command: ls, using the C programming language.

Requirements

To be able to build and run this program you'll need a macbook, because I didn't make it portable for other systems. Sorry :(. As for software Requirements, you'll need:

  • GNU make
  • GCC

No specific versions, just update them to the latest version if you still can't build the program.

Building the program

  1. Download/Clone the source code
  2. cd into the root directory
  3. Run make

Running the program

It's pretty simple, instead of calling ls, call ./ft_ls from the root directory of the source code after building it.

Supported flags

  • Long listing display: -l
  • Display recursively: -R
  • Display all files: -a
  • Reverse sort: -r
  • Sort by modification date: -t
  • Display user ID and group ID: -n
  • Suppress owner: -g
  • Display one entry per line: -1
  • Column display: -C (Set by default)
  • Sort by creation date: -U
  • Sort by last access date: -a
  • Sort by last status change date: -c
  • Show every entry except for current and previous directories: -A
  • Sort by file size: -S
  • Colorized output: -G (Only works in long listing display)

Notes

  • You can find the project instructions by clicking here
  • The master branch has the original code, the norme branch has the normed version of it.
  • No need to mention the odd spacing in files, I'm using a tab size of 4.
  • It's not fast and there are a lot of memory leaks, I'll come back and fix those later.
  • I know comments would have been super useful, this is kind of a big code base, but I'm trying to go fast in my school program, I'll make sure to add them later.
  • There are probably better ways to implement it, but we are limited by a set of functions at my school (just to make it harder and give us a deeper understanding of what's happening in the back), please, review the project instructions before you explain how X or Y would have been a better way to do it ;)

Sponsors

Sponsor

Enjoy!

ft_ls-1's People

Contributors

nickdotht avatar

Watchers

James Cloos 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.