D347th
D347th

Reputation: 707

Running programs on another computer in C

I am making an FTP in C for learning purposes. I know how to connect to a computer and read/write a file, but I'm having problems with running programs. My idea is to connect to the computer, cd into a directory called Available and run ls -l or dir depending on what type of operating system the computer the client has connected to has. After I run one of the commands I want to be able to list the results on the client's computer. My question is, is this possible and if so what would I do? Thank you for reading.

Upvotes: 0

Views: 178

Answers (1)

user400055
user400055

Reputation:

Don't run console commands like that. Use the operating system's API / system calls to enumerate files in the current directory.

Windows: FindFirst/FindNextFile APIs Linux: http://www.cs.cf.ac.uk/Dave/C/node20.html#SECTION002000000000000000000 <-- this should help for linux

Upvotes: 2

Related Questions