diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2011-04-08 20:19:53 +0000 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2011-04-08 20:19:53 +0000 |
commit | ac385dac17d3c1785d7ef4b1a461de7806a915c7 (patch) | |
tree | 3b636139f732db3685347199871b5df9df745ed5 /README | |
parent | e18c60fa063b4c74bfd8787ea862358cadfbf598 (diff) | |
download | pysendfile-ac385dac17d3c1785d7ef4b1a461de7806a915c7.tar.gz |
adds README and LICENSE
Diffstat (limited to 'README')
-rw-r--r-- | README | 69 |
1 files changed, 69 insertions, 0 deletions
@@ -0,0 +1,69 @@ + +================================= + About +================================= + +A python interface to sendfile(2) system call: +http://code.google.com/p/py-sendfile/ + + +================================= + Install +================================= + +$ sudo setup.py install + +...or: + +$ easy_install py-sendfile + + +================================= + Supported platforms +================================= + +Linux +OSX +FreeBSD +Dragon Fly BSD +AIX (non properly tested) + + +================================= + Example usage +================================= + +import socket +import errno +from sendfile import sendfile + +file = open("somefile", "rb") +sock = socket.socket() +sock.connect(("127.0.0.1", 8021)) +offset = 0 + +while 1: + try: + sent = sendfile(sock.fileno(), file.fileno(), offset, 4096) + except OSError, err: + if err.errno == errno.EAGAIN: # retry + continue + raise + else: + if sent == 0: + break # done + offset += sent + + +================================= + Authors +================================= + +py-sendfile was originally written by Ben Woolley including Linux, FreeBSD +and Dragonfly BSD support. + +Later on Niklas Edmundsson took over maintenance. + +It has almost completely rewritten by Giampaolo Rodola' (g.rodola@gmail.com) +who is now maintaining the module. + |