I have to code a FTP server and I have a problem on how data is transferred.
I'm using ftp command on linux to test it and I'm currently working on LIST
, which sends the list of files/directories in the working directory. Everything works fine (ftp well prints the list of files) except that ftp prints the following warning:
WARNING! 5 bare linefeeds received in ASCII mode
File may not have transferred correctly.
I would like to remove that warning, I think ftp is expecting binary data but I don't know how to send data like that through socket, I'm currently doing the most basic way to send ls
result:
dup2(dst_channel, 1);
execlp("ls", "ls", "-l", NULL);