-
Notifications
You must be signed in to change notification settings - Fork 0
/
CSftp.c
34 lines (24 loc) · 884 Bytes
/
CSftp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include "dir.h"
#include "usage.h"
#include "controlServer.h"
// Here is an example of how to use the above function. It also shows
// one how to get the arguments passed on the command line.
int main(int argc, char **argv) {
// This is some sample code feel free to delete it
// This is the main program for the thread version of nc
int i;
// Check the command line arguments
if (argc != 2) {
usage(argv[0]);
return -1;
}
connectControl(argv[1]);
// This is how to call the function in dir.c to get a listing of a directory.
// It requires a file descriptor, so in your code you would pass in the file descriptor
// returned for the ftp server's data connection
//printf("Printed %d directory entries\n", listFiles(1, "."));
return 0;
}