Skip to content

Implementation of classes and functions for working with files via tftp

License

Notifications You must be signed in to change notification settings

dentist128/uc_tftp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uc_tftp

Implementation of classes and functions for working with files via tftp.

It is part of the Unicon project.

https://unicon.10k.me

Usage:

Install
pip install --user uc-tftp
and use
from uc_tftp import TFTPReceiver

Examples:

as iterator

receiver = TFTPReceiver(timeout=3)  
for data in receiver:  
	print(data)  

as function

receiver = TFTPReceiver(timeout=3)  
receiver.recvto("/path/to/destination")  

with filename

receiver = TFTPReceiver(timeout=3)  
receiver.open()  
with open(receiver.filename, "w") as file:  
    for block in receiver:  
        file.write(block)  

Exceptions

May raise exceptions in the following cases:

NoWRQPacket

If the connected client tried to perform a non-WRQ operation (data recording).

NoIncomingConnection

If there were no connections in the allotted time.

ErrorReceived

If error packet was received from client.

UnexpectedOpcode

If an unexpected opcode is received during data transfer.

About

Implementation of classes and functions for working with files via tftp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages