RE: Perl vs. Python for text manipulation

Discussion in 'Python' started by Tim Peters, Jan 24, 2004.

  1. Tim Peters

    Tim Peters Guest

    [Jeff Epler]
    > The "unlocked I/O" mentioned earlier refers to locking inside the
    > standard C library, so Python can't avoid it except by calling
    > non-portable functions such as getc_unlocked* or by using lower-level
    > I/O primitives such as posix read(2)/write(2).


    Current Pythons do use getc_unlocked() on platforms that have it.

    ....

    > * Actually, my getc_unlocked() manpage says that the function is in
    > POSIX.1, so this may be as portable as read/write would be


    Alas, it isn't. Python uses read()/write() on all platforms (there is no
    known Python platform that doesn't supply them). getc_unlocked() is rarer.
    See fileobject.c for the dreadful hack used if getc_unlocked() isn't
    available (but, hack or not, on some platforms that's faster than using
    getc_unlocked; there are #defines you can play with to try it both ways).
    Tim Peters, Jan 24, 2004
    #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.
Similar Threads
  1. jared in ecs

    Perl string manipulation

    jared in ecs, Oct 22, 2003, in forum: Perl
    Replies:
    2
    Views:
    805
    Roy Johnson
    Oct 22, 2003
  2. Dave
    Replies:
    1
    Views:
    2,551
    J├╝rgen Exner
    Dec 22, 2007
  3. Selwyn Leeke
    Replies:
    3
    Views:
    141
    Anno Siegel
    Sep 15, 2003
  4. Bryan

    Perl array manipulation questions

    Bryan, May 20, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    149
    Web Surfer
    May 21, 2004
  5. siddhartha mulpuru

    cron manipulation using perl

    siddhartha mulpuru, Sep 17, 2004, in forum: Perl Misc
    Replies:
    4
    Views:
    160
    Gunnar Hjalmarsson
    Sep 18, 2004
Loading...

Share This Page