Click to See Complete Forum and Search --> : copy copy copy


veeco
10-08-2002, 12:35 PM
Is there any method i can use to copy a file to the other PCs in a LAN from my program without using socket???

bwkaz
10-08-2002, 08:48 PM
If the data has to go across the network at any point, you (or someone) will be using sockets at that point... maybe not directly, but they'll be there, and you'll want to know how they work in case you have problems...

If you want to write a file transfer program for a network, you will use sockets in one form or another... again, maybe not directly, but they'll be there...

veeco
10-09-2002, 10:57 AM
well, it seem that i don't have choice except socket.:rolleyes:
so, that mean all the PCs must be able to 'listen' for a connection to enable file copy to it. Am i right???
Thanks a lot.

bwkaz
10-09-2002, 01:02 PM
Yes.

Although if you're running Windows, they're already listening on the nmb and smb port, so if you were to connect to that port, and speak the smb protocol, you would be able to transfer files.

Likewise, if the target computer is running an FTP server, and you were to connect to the FTP port and talk the FTP protocol, you'd be able to transfer files.

Same with sftp (which is a lot more secure than FTP, but also a good bit harder to "speak").

In any of these cases, I'd think that using the program that was intended to do the transfers would be a better idea -- scp, sftp (those speak the sftp protocol), ftp (for FTP), or mount -t smbfs //computername/sharename /path/to/an/empty/directory and then use the normal file handling programs (cp, mv, etc.) to do your copying. Be sure you umount it before you're done, though.

veeco
10-10-2002, 01:41 PM
That's great, it's useful info to me. But sadly, the PCs that i work on were configured as workstation that use for testing parallel program, RH7.2, no FTP, no Samba.:(
Any other solutions for the file copying???
If not i've to work out a small program that can listen on a port.
Thanks again!

bwkaz
10-10-2002, 02:25 PM
No web server, either, I assume? HTTP isn't really hard to speak, so if they did happen to run web servers, your client could talk to that. But I kinda doubt that they'd have a web server if they don't even have ftp...

Yeah, it does sound like you'll need to write a server to talk to.

You may be able to find socket wrappers on freshmeat. I know Qt has a QSocket class (but don't use Qt for just its sockets! that would be massive overkill!), and there are probably others.

veeco
10-11-2002, 11:32 AM
Yeah, you got it right, no web server.
I'm using gtk and never touch QT before. I'm fine with <sys/socket.h> so far.
OK, i think i can solve the problem soon and thanks again.