ipcopy
Copies files over IP in a windows command shell.
Updated 2002-12-29
ipcopy is a handy command line tool to copy files
over IP between two computers. it allows you to exchange files between two
computers when no transfer daemon/file sharing is available. It uses a
client/server scheme over IP protocol. One computer runs the program as server
and the other runs the file transfer command -either get or put-. The server
mode can be either full access or read only.
ipcopy uses my own CSocket
class, which is also documented.
ipcopy is able to run in 3 different modes : Client, Read Only Server or Full Access Server.
| Command Line | What does it do ? |
| ipcopy server | Server, read only. Files can be downloaded from entire disk (assuming the client already knows path to desired file) |
| ipcopy fullserver | Server, full access (r+w) Same as read only + files can be written/overwritten to ipcopy current directory |
| ipcopy get ipaddr
PathAndFileName e.g. ipcopy get 1.1.1.1 c:\tmp\hop.zip |
Client trying to read PathAndFileName from server located at
ipaddr. PathAndFileName refers to the remote file structure. |
| ipcopy put
PathAndFileName ipaddr e.g .ipcopy put h:\backup\today.zip 1.1.1.1 |
Client trying to write PathAndFileName to server located at
ipaddr (requires full access server). PathAndFileName refers to local file structure |
All messages start with one byte stating protocol version (currently 0). The
second byte states the message type as follows :
#define
TRANSFER_READ 'R'
#define TRANSFER_WRITE 'W'
#define TRANSFER_DENIED 'D'
#define TRANSFER_OK 'O'
#define
TRANSFER_FILE 'F'
Each message has a specific format :
| Message | Byte Stream |
| TRANSFER_READ | [0] protocol version [1] 'R' [2,3] File name length (path + name) coded on 2 bytes [4...(4+FileNameLength)] File name |
| TRANSFER_WRITE | [0] protocol version [1] 'W' |
| TRANSFER_DENIED | [0] protocol version [1] 'D' |
| TRANSFER_OK | [0] protocol version [1] 'O' |
| TRANSFER_FILE | [0] protocol version [1] 'F' [2,3] File name length (no path) coded on 2 bytes [4...N(=4+FileNameLength)] File name [N...(N+8)] File Length coded on 8 bytes [(N+8)...] File bytes |
TRANSFER_READ :
1) Client connects to server and immediately issues a TRANSFER_READ command
2) Server validates protocol version and command type. Client can be rejected
for invalid request or protocol version.
3) Server sends file through TRANSFER_FILE message
4) Server closes socket connection.
TRANSFER_WRITE :
1) Client connects to server and immediately issues a TRANSFER_READ command
2) Server validates protocol version and command type. Client can be rejected
for invalid request or protocol version.
3) Server either issues either TRANSFER_OK or TRANSFER_DENIED message, depending
on server mode
4) Client sends file using TRANSFER_FILE message.
5) Server closes socket connection.
Program only : ipcopy.zip
Package with source code : ipcopy_src.zip
(poorly documented C++)
You can reach me at jc@jollant.net for question, comments, suggestions.
This stuff is absolutely not copyrighted by Jean-Cedric Jollant. You may distribute it as you wish. I honestly don't care. :)