Filling up commands.getstatusoutput's buffer

Discussion in 'Python' started by travislspencer@gmail.com, Jul 20, 2005.

  1. Guest

    Hey,

    Has anyone ever had commands.getstatusoutput's buffer fill up when
    executing a verbose command? If so, what workaround did you use?
    Did you just pipe the output into a file and then read it in or
    fork a processes or something else?

    --

    Regards,

    Travis Spencer
     
    , Jul 20, 2005
    #1
    1. Advertising

  2. Jeff Epler Guest

    On Wed, Jul 20, 2005 at 03:10:49PM -0700, wrote:
    > Hey,
    >
    > Has anyone ever had commands.getstatusoutput's buffer fill up when
    > executing a verbose command? [...]


    How much output are you talking about? I tried outputs as large as
    about 260 megabytes without any problem. (RedHat 9, Python 2.2)

    >>> len(commands.getoutput("dd if=/dev/zero bs=512 count=512000 2>/dev/null"))

    262144000
    >>> 512 * 512000

    262144000

    Jeff

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)

    iD8DBQFC36qmJd01MZaTXX0RAoRfAJ0QXk5Gi6nTAScTeFZfodyVSW/YcACfeSDe
    aNwttsH8MQPcRowvtySRmjA=
    =SsB0
    -----END PGP SIGNATURE-----
     
    Jeff Epler, Jul 21, 2005
    #2
    1. Advertising

  3. Guest

    Jeff Epler wrote:
    > On Wed, Jul 20, 2005 at 03:10:49PM -0700, wrote:
    > How much output are you talking about?


    Honestly, I don't know. I came on to a project were they said they
    were hitting up against some limit, and had a hack to work around it.
    I just wondered if others had hit some limit too and found diffrent
    workarounds.

    > I tried outputs as large as
    > about 260 megabytes without any problem. (RedHat 9, Python 2.2)
    >
    > >>> len(commands.getoutput("dd if=/dev/zero bs=512 count=512000 2>/dev/null"))

    > 262144000
    > >>> 512 * 512000

    > 262144000


    I tried the same tests on CentOS, Python 2.3.4 and on Solaris 9 w/
    Python 2.3.3. No problems.

    --

    Regards,

    Travis Spencer
     
    , Jul 21, 2005
    #3
    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.
Similar Threads
  1. David Carroll
    Replies:
    2
    Views:
    627
    Peter Otten
    Sep 13, 2003
  2. n.o.
    Replies:
    0
    Views:
    337
  3. Hari Sekhon
    Replies:
    0
    Views:
    323
    Hari Sekhon
    Oct 2, 2006
  4. Hari Sekhon
    Replies:
    1
    Views:
    831
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 2, 2006
  5. Fredrik Lundh
    Replies:
    0
    Views:
    422
    Fredrik Lundh
    Oct 2, 2006
Loading...

Share This Page