Logo Miradil's Blog
  • Home
  • About
  • Skills
  • Experiences
  • Education
  • More
    Projects Publications Recent Posts
  • Posts
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Tags
  • Backend
  • Basic
  • Binary Search Tree
  • BinarySearch
  • Bit Manipulation
  • C
  • Caching
  • Codeforces
  • Disjoint Set
  • Django
  • DSA
  • Easy
  • Eolymp
  • File Structure
  • File System
  • ForBeginners
  • Formatted I/O
  • HackerRank
  • HowTo
  • ICPC
  • Interactive
  • Interview
  • Intro
  • Leetcode
  • Library Functions
  • LinkedList
  • Linux
  • Medium
  • Open Source
  • Podcasts
  • Programming
  • Public Speaking
  • Python
  • Roadmap
  • Stack
  • System Calls
  • The Diary of a CEO
  • Tricky
  • Vinh Giang
  • Web Development
Hero Image
Let's Rewrite Linux 'ls' command: Getting the list of files and their info

In this article we will start collecting info about files If you want to know more about command, please read Part 1. If you want to know how we configured tests, check Part 2. Note: Source codes can be found at: https://github.com/Miradils-Blog/linux-ls Getting the list of files First things first, our file structure looks like this (tree command was used for output): We have separate folder with different types of files for us to cover all cases. For now, we will hard-code the folder where listing will happen, just focusing on functionality. So, how do we get the list of all files and their respective data about ownership, size, links etc.? Lucky for us, C provides function for this (and honestly, for everything else as well):

Wednesday, May 10, 2023 | 9 minutes Read
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Projects
  • Publications
  • Recent Posts
Contact me:
  • miradil.zeynalli@gmail.com
  • mmzeynalli
  • Miradil Zeynalli
  • @mmzeynalli
  • Miradil Zeynalli
  • @mmzeynalli

Toha Theme Logo Toha
© 2024 Copyright.
Powered by Hugo Logo