summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2011-04-08 20:19:53 +0000
committerGiampaolo Rodola <g.rodola@gmail.com>2011-04-08 20:19:53 +0000
commitac385dac17d3c1785d7ef4b1a461de7806a915c7 (patch)
tree3b636139f732db3685347199871b5df9df745ed5 /README
parente18c60fa063b4c74bfd8787ea862358cadfbf598 (diff)
downloadpysendfile-ac385dac17d3c1785d7ef4b1a461de7806a915c7.tar.gz
adds README and LICENSE
Diffstat (limited to 'README')
-rw-r--r--README69
1 files changed, 69 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..a078a5a
--- /dev/null
+++ b/README
@@ -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.
+