GNU time(1) reports wrong I/O count
Question: on fedora 16, running time(1) on a small program that just does 10 writes of
1024 bytes to a file, reports "24 outputs". I was expecting the I/O count to
be 10. Note that if i run strace on the program I can see the 10 write()
calls. So what is the I/O count as reported by time(1)? thanks a lot

    
    
    #!/usr/bin/python
    
    import os
    import pdb
    
    SIZE_IO=1024
    IONB=10
    
    def test1(file):
        #pdb.set_trace()
        buffer= '\x01' * SIZE_IO
        fd = os.open(file, os.O_CREAT|os.O_RDWR, 0777)
        for ix in range(IONB):
            len = os.write(fd, buffer)
            print len
        os.close(fd)
        return 1
    
    if name__== "__main":
        test1("ttt.txt")
        print 'ok'
    


Answer: Isn't each print going to cause a write as well?

