Sep 23 2005

Why closed source languages suck.

Ok, I just needed to do something simple today. I wanted to pass a list of files at the command line to jedit like this:

/usr/bin/jedit -reuseview "/path/to/file1.foo" "/path/to/file2.bar"

Ok, most any software will accept this as two file paths separated by quotes. But Java? No, Java only sees this as two strings separated by spaces and completely ignores the quotations. So...

/usr/bin/jedit -reuseview "/path/to/path with space/file1.foo" "/path/to/file2.bar"

This is interpreted as you want to open four files:

/path/to/path
with
space/file1.foo
/path/to/file2.bar

And it opens all four of these files just fine. Now I was quite shocked to find out that this is a bug in the way the Java shell script deals with parameters. And it has been this way for several years! A good example of how the bureaucracy of closed source anything creates situations just like this.

I did however submit a fix to the Gentoo Java Hurd for the jedit executable (bash script), and the fix was committed to cvs. It doesn't allow multiple files to be submitted, but does allow for quotes to enclose a single file name for exclusion of spaces in file names and paths.

free b2evolution skin

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)

You can just use your OpenID to provide your name, e-mail and url.

Too Cool for Internet Explorer