Re: There's a whole in my java dear list group, dear list group...
Re: There's a whole in my java dear list group, dear list group...
- Subject: Re: There's a whole in my java dear list group, dear list group...
- From: "Jonathan Fleming" <email@hidden>
- Date: Sat, 12 Jul 2003 11:09:20 +0100
OK, Chuck, Steve and Lucas
My nonsense got a bit of sense from you guys, or maybe I just woke up with a
fresh head, I'm beginning to understand now, so thanks for putting up with
this.
From: Chuck Hill <email@hidden>
To: "Jonathan Fleming" <email@hidden>,
email@hidden
Subject: Re: There's a whole in my java dear list group, dear list
group...
Date: Fri, 11 Jul 2003 18:07:24 -0700
Jonathan,
1. Please, please, please stop crossposting. You are nearly overtaking the
penile enlargement messages in my inbox and are way in front of the
Nigerians wishing to make me rich.
That's funny...
OK, I mainly post to Apple and Omnigroup together but I'll post to just
apple from now on. I'll only crosspost when I think I'm having a baby... ;^)
2. You also have a hole in your English. Checkout www.dictionary.com for
the crucial difference between whole and hole. :-)
Even funnier...
Yeah, that's what happens when you're in a rush, frustrated and don't read
back your post before sending it.
OK, now I feel better.
:^) ain't it good when you get these things off your chest... ;^)
At 11:08 PM 11/07/2003 +0100, Jonathan Fleming wrote:
>OK, I've been stuck on getting runtime.exec to exec (Re: External Command
>Call - More Java Than WebObjects) and it is now obvious to me that there
>must be a great big whole in my java knowledge.
>I've been trying figure out what such things as, "-f", "-a", "-o" etc
are.
>
They are options unique to a particular "command" which is just a special
kind of program. Each command has its own options, some are similar like
-f for file only because of the English language. The go after the command
on the command line to alter or control the behaviour of the command, e.g.
gnutar -x -f mytar.tar
Which extracts (-x) the contents of the TAR (Tape ARchive) file (-f)
mytar.tar
In Java,
Runtime.getRuntime().exec("gnutar -x -f mytar.tar");
Which likely won't do what you want as the working / current directory is
wrong. Try:
Runtime.getRuntime().exec("gnutar -x -f mytar.tar", null, new
File("/path/to/my/dir");
or even
Runtime.getRuntime().exec(new String[] {"gnutar", "-x", "-f", "mytar.tar"},
null, new File("/path/to/my/dir");
OK, that was all off the top of my head and its been well over a year since
I've used this, so expect problems. :-)
You expect nothing but in this game ;^)
I strongly suggest that you spend some time wandering through the Java
Turorial
http://java.sun.com/docs/books/tutorial/
And spend some time at the JavaRanch "a friendly place for Java greenhorns"
http://www.javaranch.com/
(for those not familiar with the term, greenhorn is an American western
term similar to newbie :-)
Ok, I've had a quick look at the home page and I like this already, but to
send me on my way can you tell me where to find what these options mean as
there is obviously a standard for them if -f means file and -x I presume is
execute. I think a good deal of the problem is that I don't know what any of
these mean or where they come from.
Cheers Guys
Jonathan :^)
The latter is a more appropriate place for basic Java questions. The
former a good instructional resource, including this:
http://java.sun.com/docs/books/tutorial/essential/system/runtime.html
>I
>know it might sound obserd to you guys but it's as plain as saying, "I
don't
>know what these are or how they work" to me. I thought these were
supossed
>to be used as references to a long sting that would be used in the
command
>line, but I found when I wrote: String -a = "my argument string"
>
-a is clearly not an valid Java indentifier. Could you write this?
NSTimestamp -date = new NSTimestamp();
>I found
>that I should have been declaring the -a option as a int or Integer...
>unless I was doing something wrong and I obviously was.
I suspect the latter is the case. :-)
And the rest is wandering way, way off the path you need to be on.
Hope that helps some.
Chuck
>After a bit of diging i've found out that these types of options should
be
>used to effectivly keep your java portable they are options that follow
the
>POSIX convention. The clearest description of thses options i have found
is
>this:
>
>Command-Line Arguments warns that the use of command-line arguments in a
>Java program may cause that program to be unportable (that is, it will
not
>be 100% Pure Java). If a program requires command-line arguments, then it
>should follow the POSIX conventions for them. The POSIX conventions are
>summarized here:
>An option is a hyphen followed by a single alphanumeric character, like
>this: -o.
>An option may require an argument (which must appear immediately after
the
>option); for example, -o argument or -oargument.
>Options that do not require arguments can be grouped after a hyphen, so,
for
>example, -lst is equivalent to -t -l -s.
>Options can appear in any order; thus -lst is equivalent to -tls.
>Options can appear multiple times.
>Options precede other nonoption arguments: -lst nonoption.
>The -- argument terminates options.
>The - option is typically used to represent one of the standard input
>streams.
>
>but in trying to find a deeper meaning to this I now find my head is
>beginning to burst because I'm getting too much technical jargon when I
just
>want what it all means in plain English. I'm no technical guru, now Java
>genious or WebObjects pundit, but inspite of my failings I've hung in
there
>learning a fair amount of every process needed to become a WebObjects
>developer for someone who is not technically trained, simply because I
love
>the challenge and my Mac products. But right now, however, I'm feeling
>incredibly stupid and too afraid to ask any further questions about the
>subject of External Command Calls which I am stuck on because I feel like
a
>jerkoff. Sadly I have to do something or else I'm dead in the water and
I'm
>not ready for that, so if someone can point me to a good tutorial that
>explains what POSIX is, the options I mentioned earlier (what they are ,
how
>to use them etc), I would really appreciate it. I don't know much about
Unix
>commands or Shell commands for that matter but they look like what is
used
>when tarring and untarring -c -v -f etc. Maybe I need to learn more about
>standard shell commands as I only know the basics like dir, mkdir, mv,
tar,
>copy, basically all those you will find when you run help in say a
Windows
>NT Shell, I don't know, someone point me in the right direction please
>because the frustration is eating me up.
>
>Come on you are the guys that know this stuf, make me knowledgeable... I
>want to be knowledgeable!
>
>Thanks
>Jonathan :^)
>
>Knowledge is a gift that is not ours to keep, but ours to pass on for the
>benefit of others.
>
>_________________________________________________________________
>Express yourself with cool emoticons - download MSN Messenger today!
>http://www.msn.co.uk/messenger
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_________________________________________________________________
Find a cheaper internet access deal - choose one to suit you.
http://www.msn.co.uk/internetaccess
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.