SYC File Transfer Protocol - Allexin/ShareYourClipboard GitHub Wiki

Network methods(over TCP):
request
OpenCurrentClipboardFiles()
response
CurrentClipboardFiles
guid ClipboardHandle
int TotalSize
int ItemsCount
[node
int RelativeFileName
int Size
bool IsDir
bool IsExecutable
int ChildsCount
[node ...] Childs
] RootItems

request
OpenFile(guid ClipboardHandle, string relativeFileName)
response
FileOpened
string relativeFileName
guid FileHandle
bool IsExecutable
int Size

request
GetFilePart(guid ClipboardHandle, guid FileHandle, int start, int size)
response
FilePart
guid FileHandle
int ResponseDataSize(equal size)
[char] data

request
CloseFile(guid ClipboardHandle, guid FileHandle)

request
CloseClipboard(guid ClipboardHandle)

error response
Error
int Operation
int Code

Client:
User press "Paste remote files" hotkey
Show "process" dialog
GetCurrentClipboardFiles()
...Files Received
Show "Select folder" dialog
Compare received files list and existing files. Show "Overwrite/Skip/Cancel" dialog if necessary
Calculate total files size and show "copy dialog"
Create folder structure
Create files list
for each file:
{
OpenFile()
...File Opened
while not EoF:
[
GetFilePart()
...Part Received
Save part to memory
]
Save file to disk
}