Re: file write IOError Invalid argument

Discussion in 'Python' started by Gabriel Genellina, Jul 20, 2009.

  1. En Thu, 16 Jul 2009 17:41:39 -0300, Robert Robert
    <> escribió:

    > I am trying to write a binary string to file on a windows network share.
    > I get an IOError. I've read that it is because the file size is too
    > large. I did a type( binaryString) and saw that it was type "str". So I
    > loop through it one by one element and use f.write to write to file, and
    > it worked without any error. However it took a long while to write to
    > file. I was wondering how I could split this binary string into N number
    > of chunks efficiently and write them to file.


    some_string[i:i+BLOCK_SIZE]
    returns a slice of the original string, starting at position i, with
    length BLOCK_SIZE.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Jul 20, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page