GeeksforGeeks » C/C++ Programming Questions

How can we traverse through all the files in a folder and the subfolders?

(2 posts)

Tags:

  1. geek4u
    guest
    Posted 1 year ago #

    How can we traverse through all the files in a folder and the subfolders. What system calls should be used?

  2. Misraji
    Member
    Posted 1 year ago #

    Try the following command:
    strace ls -R &> ls.strace && cat ls.strace

    It gives the list of system calls made by ls command.
    Some of them are:
    open, read, close, mmap, fstat, mprotect, access,

    Lots of tertiary ones too.

    ~Ashish


Reply

You must log in to post.

RSS feed for this topic