Berkeley CSUA MOTD:Entry 17936
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/12/25 [General] UID:1000 Activity:popular
12/25   

2000/4/5-6 [Computer/SW/Languages/Perl] UID:17936 Activity:insanely high
4/5     In C/C++, how do you implement "ls" type of functionality without
        using a "system" call?  Where can I get the source code for "ls"?
                                \_ http://ftp.gnu.org, <DEAD>ftp.freebsd.org<DEAD>,
                                   http://ftp.redhat.com, and fifty million others
        \_ Your implementation of a directory/folder is system-dependent.  Hence
           you need to use system calls.
        \_ Okay, found something for WinNT: findfirst, findnext using io.h
        \_ POSIX/UNIX: opendir/readdir/closedir.  Other OS'es: see your OS'es
           API docs.
           \_ thanks.  but what a pain.  why can't someone put a layer on
              top of that and make it more portable across various OS's.
                \_ Sun did.  It's called "Java".
                   \_ this is a stupid answer. POSIX api *is* supposed to be
                      the multiplatform solution. opendir/readdir/closedir
                      are very much multiplatform and are definitely not UNIX
                      only. if your OS doesn't support it, looking for YET
                      another "standard" library is asking for lack of
                      portability. -ali.
                                \_ Java is better than POSIX. POSIX
                                   compliance is limited mostly to UNIX
                                   systems (and WinNT) while Java is
                                   usable on Mac,Win*,*nix and others.
                                   And once you compile your java files
                                   into classfiles you can give them
                                   to someone on a different platform
                                   and they can run it without needing
                                   to recompile.
                        \_ Use ACE! It works everywhere and does everything.
                           ACE will rule the world! ACE ED will be the standard
                           editor/library/os/everthing.
                   \_ Fuck Java, use Perl!
                        \_ Java has real OO, not some stupid hack like
                           in Perl! We should ditch Perl5 and go back to
                           Perl4. If you need OO, then use Java. Also
                           if your are doing web stuff that accesses
                              It's also
                              a royal pain to set up with any real webserver.
                           ldap servers or db servers Java (servlets)
                           are much better than Perl cgi. And don't give
                           me that crap about fast cgi or mod_perl. There
                           are several problems with reusing server
                           connections.
                           \_ OO is a style of programming that need not be
                              supported by language constructs.
                           \_ Uh.. crack.  Have you actually looked at the
                              performance numbers for mod_perl vs. java
                              servlets?  Java loses.  Heavily.
                              \_ URL?
                             \_ http://www.chamas.com/bench/hello_bysystem.html
                                --dbushong
                                It's also a royal pain to set up with any
                                real webserver.
                                \_ This page is bs and it even states that:
                                   "These benchmarks do not represent real
                                    world scenarios."
                                    Perl is faster for simple form processing
                                    and basic text output. But how many cgi's
                                    do that anymore. Most are wrappers for
                                    accessing services like a db or ldap or
                                    corba or a tib. Perl loses here.
                                    Benchmark a java servlet that does jdbc
                                    odbc access using a connection pool
                                    against a perl cgi that needs to open
                                    a db connection every time it is invoked.
                                    Java beats the pants off of perl for
                                    most transactions. Same for LDAP. I
                                    know that Java is better since I worked
                                    to convert a large perl cgi based product
                                    (worked on the perl cgi's in the original
                                    version) to java servlets for Cisco and
                                    we got ~ 1.5 to 2x improvement on the
                                    server side performance. Setting up JRun
                                    or Appache JServe isn't that hard. If you
                                    think JRun's setup is hard your admin fu
                                    is really weak. The most recent versions
                                    required only 5 lines in httpd.conf.
                                    \_ JRun is an utter piece of shit.  I
                                       had to restart it once a day when
                                       it barfed all over itself.
                                        \_ I haven't had this problem for the
                                           last few versions. But I'm using
                                           JServe now since I don't like
                                           Alaire's upgrade policy regarding
                                           old Live cust. They asked me to
                                           pay full price for the latest vers.
                                       mod_perl does not need to open new
                                       database connections every time;
                                       that's what Apache::DBI is all about.
                                       And saying you got a performance
                                       improvment over "perl cgi" is idiotic.
                                       Of course you did, the compile/exec
                                       penalty on non-mod_perl is lethal.
                                       \_ We were using mod_perl, but Apache::DBI
                                          wasn't stable enough for our needs.
             \_ POSIX API exists for most OS's.
             \_ Tcl/Tk also has platform independant APIs for this kind
                of thing.  I've used Tcl/Tk and I highly recommend it. -emin
                \_ Tcl/Tk is pretty junky compared to Perl. If you need
                   to use a scripting language use Perl or Bourne Shell.
                \_ there really is no point in doing Tcl in my opinion.
                   Instead you should use python. It's easier to learn,
                   it's easier to write wrappers for your C code in it,
                   it runs faster (actually, i don't know about tcl8.0),
                   and it's got builtin support for OO. -ali
                   \_ I checked out the python web page and it does seem
                      pretty nifty.  I'll try using it next time instead
                      of Tcl. Thanks. -emin
                        \_ Any language that uses white space for scope
                           is pretty junky. Next they will dictate the
                           columns that I can use. Fortran anyone?
                \_ tcl + python are academia languages and are USELESS
                   PERL R3WL$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Cache (185 bytes)
www.chamas.com/bench/hello_bysystem.html
Document Not Found We were unable to find the document you requested. Please try the main benchmark site, to find the document you are looking for. Chamas Enterprises Inc. References 1.
Cache (552 bytes)
ftp.gnu.org
Index of / Name Last modified Size Description Parent Directory 27-Apr-2004 16:44 - MISSING-FILES 23-Oct-2003 12:57 17k MISSING-FILES.README 13-Aug-2003 19:05 4k before-2003-08-01.md5sums.asc 23-Oct-2003 12:55 396k gnu/ 12-May-2004 07:16 - iso/ 02-Aug-2003 08:52 - lpf.README 16-Feb-1993 03:00 1k ls-lrR.txt 27-Jul-2003 02:19 23M non-gnu/ 14-Aug-2003 13:23 - old-gnu/ 05-Dec-2003 11:17 - pub/ 15-Apr-2004 14:59 - savannah/ 15-Jan-2004 15:50 - third-party/ 02-Aug-2003 08:01 - welcome.msg 13-Aug-2003 19:09 1k Apache/1.3.26 Server at ftp.gnu.org Port 80
Cache (161 bytes)
ftp.redhat.com
Search Name Last modified Size Parent Directory 17-Nov-2003 12:46 - pub/ 11-Nov-2003 11:18 - Copyright 2004 Red Hat, Inc. All rights reserved. Hidden links: 14.