views:

97

answers:

4

Hello! I would like to know if I can use g++ to compile C++ source files stored on an FTP server? Can this be done?

Thanks

NOTE: The FTP server is within the local network

+7  A: 

You can't execute commands over FTP, nor can you operate directly on files stored on an FTP server unless you have mapped the FTP server to a filesystem. How to do the latter depends on your operating system.

Since you said g++, I assume Linux, so look into FTPFS.

Tyler McHenry
+1 for FTPFS, used that for several projects.
OneOfOne
OneOfOne: together with GCC?
+1  A: 

No, this is not possible. Ftp doesn't allow you to execute programs on the server, it is just used to transfer files. To execute programs (like the compiler) you need some different kind of access to the server, like for example with Ssh.

sth
+1  A: 

If you are using a Linux system (and probably any *nix or BSD flavout as well) then yes it is possible if the ftp-server is mounted as a filesystem on your machine, like Tyler McHenry wrote.

It is however not neccessary to "look into FTPFS" if you are using any recent Gnome-based distro. In Ubuntu (9.04) I can do "Places"->"Connect to server" and choose FTP. Then, when the folder is opened in Nautilus you can find the mounted directory in ~/.gvfs/ and then you should be able to compile it without any trouble at all.

I would be very surprised if KDE did not have the same feature, but the directory will be mounted somewhere else.

kigurai
A: 

Does the FTP server have a public website that works with scripting languages, such as PHP? If so, you could upload your source code, edit a PHP file that calls system and compile your code.

In general this probably isn't a good idea: It's a slow, manual process & could be subject to security problems if the PHP script lets you edit the compilation command.

Pete