Message217058
1) I really don't like the use_fallback argument: as a user, I don't
care if it's using sendfile/splice/whatever WIndows uses.
I view this as a channel transfer (like Java's
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#transferFrom(java.nio.channels.ReadableByteChannel,
long, long)), which moves bytes around from one FD to another.
If the user want precise control, he can just go ahead and call the
syscall itself.
Apart from complicating the prototype, what do this bring?
2) Just returning the number of bytes sent is fine
3) I really don't like the blocksize argument. Just use a really large
value internally to minimize the number of syscalls, that's all that
matters. I've *never* seen code which explicitly uses a blocksize: in
99% of cases, it just uses stat to find out the file size, and call
sendfile with it. Trying to be consistent with ftplib is IMO a bad
idea, since the API is just completely broken (I mean, just
sending/retrieving a file is complex). A useful parameter instead
would be to support sending only part of the file, so adding a count
argument.
You can have a look at
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html#transferFrom(java.nio.channels.ReadableByteChannel,
long, long) for an example many people bash Java, but they've designed
some great APIs :-) |
|
Date |
User |
Action |
Args |
2014-04-23 07:44:46 | neologix | set | recipients:
+ neologix, pitrou, giampaolo.rodola, christian.heimes, josiah.carlson, asvetlov, akira, rosslagerwall, josh.r |
2014-04-23 07:44:46 | neologix | link | issue17552 messages |
2014-04-23 07:44:45 | neologix | create | |
|