How to write C code to implement the DOS command "DIR"

Discussion in 'C' started by gates2010, Nov 9, 2007.

  1. gates2010

    gates2010 New Member

    Joined:
    Nov 9, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I am trying to implement the DIR command for my client server proj. When the client sends a list command to the server the server should list all the files in the files directory which is located in the same place as the server program.

    If you have an idea or u know any functions i could use pelase let me know

    thank u :)
     
  2. Salem

    Salem New Member

    Joined:
    Nov 15, 2007
    Messages:
    133
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Please don't PM me for 1:1 support.
    It depends which operating system the program will be running on.

    For Unix/Linux, look at the opendir(), readdir() and closedir() functions.
    For Win32, it's FindFirstFile(), FindNextFile() and FindClose() functions.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice