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$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |