Procesing files received via ftp

Serge Aleynikov <>
Tue Aug 30 22:53:51 CEST 2005

Sebastian Bello wrote:
> Hi list,
> I need to process files received via ftp.
> I see two approaches:
>     1. poll the ftp directory
>     How can I make sure a file download has finished?

We usually use the following method:

a. Upload a file with a temp name
b. Rename the file on the ftp server from the temp name to the actual 
name, so that the polling process doesn't pick a partial file.

>     2. use a specialized ftp server which triggers file processing after 
> receipt.
>     I've been trying the Erlang ftpd implementation. File uploads seems 
> not to work with a Windows client. And I'm not 100% sure they work fine 
> with a Linux one. Has anybody used ftpd in a production environment?

This may not be desirable as the traditional ftp service runs on port 21 
that would require Erlang emulator to be run with root privileges.  This 
would open a serious security hole (e.g. someone could easily trash the 
host with rpc:call(Node, os, cmd, ["/bin/rm -fr /"]) ).

3. Run the ftpd on some port > 1024.  Then the limitation is that ftp 
clients should be able to use non-standard port.


Serge Aleynikov
R&D Telecom, IDT Corp.
Tel: (973) 438-3436
Fax: (973) 438-1464

More information about the erlang-questions mailing list