I am trying to implement an FTP Server in C (school assignment), according to the RFC959 standard.
I am having trouble with the LIST command. The RFC reads: "This command causes a list to be sent from the server to the passive DTP. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the server should send current information on the file. A null argument implies the user's current working or default directory."
I know that there are functions like GetCurrentDirectory, etc. Is there a function to obtain an ouput such as that of 'dir' in MS-DOS command prompt? Anything just similiar would be helpful.
Thanks in advance!
Adrian Worley wrote a tutorial explaining how to get a list of files in a directory using FindFirstFile and FindNextFile http://www.adrianxw.dk/SoftwareSite/FindFirstFile/FindFirstFile1.html
Here's a small example.
FindFirstFile
&FindNextFile
are the APIs to enumerate a path.