QAH
QAH

Reputation: 4210

Compile C++ over FTP

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

Note: The FTP server is within the local network

Upvotes: 0

Views: 367

Answers (4)

Pete
Pete

Reputation: 10680

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.

Upvotes: 0

Hannes Ovrén
Hannes Ovrén

Reputation: 21831

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.

Upvotes: 1

sth
sth

Reputation: 229744

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.

Upvotes: 1

Tyler McHenry
Tyler McHenry

Reputation: 76710

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.

Upvotes: 7

Related Questions