Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install pysendfile

How to install pysendfile

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pysendfile
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
2.0.0 Failed View build log
2.0.0 Failed View build log
Windows (64-bit)
2.0.0 Failed View build log
2.0.0 Failed View build log
Mac OS X (10.5+)
2.0.0 Available View build log
2.0.0 Available View build log
Linux (32-bit)
2.0.0 Available View build log
2.0.0 Available View build log
Linux (64-bit)
2.0.0 Available View build log
2.0.0 Available View build log
2.0.0 Available View build log
 
License
MIT
Imports
Lastest release
version 2.0.0 on Jan 13th, 2012

About

A python interface to sendfile(2) system call.

Install

$ sudo setup.py install

...or:

$ easy_install pysendfile

Supported platforms

  • Linux
  • OSX
  • FreeBSD
  • Dragon Fly BSD
  • SunOS
  • AIX (non properly tested)

Python versions from 2.5 to 3.3 by using a single code base.

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, errno.EBUSY):  # retry
            continue
        raise
    else:
        if sent == 0:
            break  # done
        offset += sent

Subscribe to package updates

Last updated Jan 13th, 2012

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.