[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    File size of a put operation in an IOSlave
From:       Craig Howard <kde () choward ! ca>
Date:       2007-03-16 5:50:33
Message-ID: 200703152250.33348.kde () choward ! ca
[Download RAW message or body]

I tried writing an IOSlave for Amazon.com's S3 file storage system using KDE3.  
S3 functions as a giant bit bucket that can do only put and get through http 
requests.  

The problem that I ran into was that an http put operation requires 
a "Content-Length" field in the http header.  Within an IOSlave context there 
was no way for a put operation to determine the size of the file that it was 
operating on.  I realize:

1. It's impossible to always know the file size ahead of time.

2. I could just copy the file to a temporary file, stat it, then do the 
upload.

In the majority of cases, it should be possible to find out what the file size 
is and if it's not possible to determine, I could always fall back to #2.  

KDE3 did not provide a way to get the size and I haven't seen KDE4 add that 
capability.  I think it could be made standard to pass the file size through 
the metadata, but that seems wrong.  

What I'd like to see is an optional size argument added to the put() signature 
(or an overload).  I'm not sure if I'll have time to address this myself (or 
if I can climb the learning curve in time for the freeze), but I'd be more 
than willing to be involved in the discussion of the correct way to do this 
and I can be a guinea pig for whatever API is decided upon.

(BTW, KIO::SlaveBase still has two boolean parameters in the signatures of its 
methods)
-- 

Craig Howard
craig@choward.ca
BMath CompSci - University of Waterloo
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic