c - LINUX: List contents of a outside folder or of a subfolder without leaving current folder -


I have a program that sees a folder somewhere in your directory (the location is given at the start of the program ). One of its functions is that the user has to specify which content is stored in that specific folder. I was thinking of piping the ls command, but I'm sure how to get the contents of a folder in which you are not currently. help?

Thank you!

Just use LS?

  ls / path / to / directory   

Alternatively, opendir () and readdir () , use man 3 opendir and man 3 readdir >

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -