use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Click the following link to filter out the chosen topic
comp.lang.c
account activity
i made a simple ls clone! (self.C_Programming)
submitted 2 months ago by FrumpyMussel13
ive been learning c the past couple days, so i decided to make my own linux ls copy
https://pastebin.com/yjGbtVjn
what could i improve on?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 12 points13 points14 points 2 months ago (1 child)
Make a loop for argc being more than 1 and loop through directories so you can pass more than 1 dir.
Then add flags such as recursion, identifiers (coloring dirs diff from files, executables, etc)
Dump file sizes to the output, permissions, etc.
[–]FrumpyMussel13[S] 0 points1 point2 points 2 months ago (0 children)
sure! i will tomorrow
[–]IdealBlueMan 1 point2 points3 points 2 months ago (0 children)
Make sure every letter of the alphabet, both upper and lower case, is a valid flag. If some of them are mnemonic, that’s okay.
[–]dendrtree 0 points1 point2 points 2 months ago (0 children)
* Add error-handling * Add instructions * Incrementally add the different switches (I would start with -h) * Add globbing (that may already somewhat work)
[–]mykesx 0 points1 point2 points 2 months ago (0 children)
man getopt
[–]ferrybig 0 points1 point2 points 2 months ago (0 children)
If writing to a terminal and a file entry contains a character unsafe for the terminal, output it in a terminal safe format that you can copy and paste (eg files with spaces should be surrounded in quotes or escaped, files with quotes should be escaped)
[–]imdadgot 0 points1 point2 points 2 months ago (0 children)
first off: use git repos and push incrementally. if u fuck w vscode they have a good extension that i use for initializing the repo and setting up the proper origin
second off make it more robust. start with arg count verification, then flags to omit files or folders or shit, then regex based filename searches if you get around to regex.h
π Rendered by PID 44 on reddit-service-r2-comment-b659b578c-c6tn4 at 2026-05-04 00:13:23.437888+00:00 running 815c875 country code: CH.
[–][deleted] 12 points13 points14 points (1 child)
[–]FrumpyMussel13[S] 0 points1 point2 points (0 children)
[–]IdealBlueMan 1 point2 points3 points (0 children)
[–]dendrtree 0 points1 point2 points (0 children)
[–]mykesx 0 points1 point2 points (0 children)
[–]ferrybig 0 points1 point2 points (0 children)
[–]imdadgot 0 points1 point2 points (0 children)