Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Using winRAR with Java (help) on: 2008-01-14 09:20:23
I'll have to try this tomorrow. I am really thankful that no one has just spat the code at me, it's nice thinking every once and awhile Tongue
2  Game Development / Newbie & Debugging Questions / Re: Using winRAR with Java (help) on: 2008-01-13 09:11:13
Thank You

I'm having trouble with buffered readers right now (probably because it's late), but so far it just returns "-1" I don't think i'm doing it right.
Been looking at
1  
[url]http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4[/url]


Will play with it more in the morning, thank you  Grin

<edit>

Now the code looks like
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;

public class rarAllFolders
{
   
   public static void main(String args[])
   {
      File directory = new File(System.getProperty("user.dir"));
      File folders[] = directory.listFiles();

      for(int i = 0; i < folders.length; i++)
      {
         if(folders[i].getName().indexOf(".") == -1)
         {
            //rar all the folders
           try {
               System.out.println(folders[i].getName()+"                  " + folders[i]);
               Process pros = Runtime.getRuntime().exec(new String[] {"cmd.exe", "/c", "start", "rar a compressed text.txt"}); //" + folders[i].getName() + " " + folders[i].getName()});
                BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                            pros.getInputStream()));
                String inputLine;
           
                while ((inputLine = in.readLine()) != null)
                    System.out.println(inputLine);
                in.close();
           
            } catch (IOException e) {
               // TODO Auto-generated catch block
              e.printStackTrace();
            }
         }
      }
     
   }
   
}


But I don't understand
grab and read the STDERR/STDOUT from the process, so they will don't suffer from full buffers, blocking WinRAR
3  Game Development / Newbie & Debugging Questions / Re: Using winRAR with Java (help) on: 2008-01-13 05:08:58
1. Works in command line

2. Not to sure what you are asking, so probably no

Here's the code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
import java.io.File;
import java.io.IOException;

public class rarAllFolders
{
   
   public static void main(String args[])
   {
      File directory = new File(System.getProperty("user.dir"));
      File folders[] = directory.listFiles();

      for(int i = 0; i < folders.length; i++)
      {
         if(folders[i].getName().indexOf(".") == -1)
         {
            //rar all the folders
           try {
               System.out.println(folders[i].getName()+"                  " + folders[i]);
               Runtime.getRuntime().exec(new String[] {"cmd.exe", "/c", "start", "rar", "a compressed text.txt"}); //" + folders[i].getName() + " " + folders[i].getName()});
           } catch (IOException e) {
               // TODO Auto-generated catch block
              e.printStackTrace();
            }
         }
      }
     
   }
   
}


This program when run will rar all the folders in the current directory.
4  Game Development / Newbie & Debugging Questions / Using winRAR with Java (help) on: 2008-01-12 07:57:04
Using winRAR with java. I'm trying to use winrar through command line.


If I run this code the window's title is "rar a compressed text.txt"    (read "start"'s help file and it said that if a command is not provided, but a string is then the string will be the title of the window). I put winRAR in my PATH so I can run rar.exe from anywhere in cmd, but It's not seeing it as a command, just a string.
1  
Runtime.getRuntime().exec(new String[] {"cmd.exe", "/c", "start", "rar a compressed text.txt"});



also tried
1  
Runtime.getRuntime().exec(new String[] {"cmd.exe", "/c", "start", "rar", "a compressed text.txt"});

which will run rar.exe (blazes through the parameters) but then disappears without RARing text.txt -> compressed.rar

Any thoughts?
5  Game Development / Newbie & Debugging Questions / Re: Books on: 2006-03-28 01:11:38
Your right, currently I'm reviewing, but once I'm done reviewing I'll read the Java 2 Game Programming book, it has some usefull knowledge in it. And then from there I might read ("Java How To Program 3rd edition") by Deitel and Deitel, or I'll goto ("Killer Game Programming in Java"). Thanks.
6  Game Development / Newbie & Debugging Questions / Books on: 2006-03-27 05:45:11
Too long? here's the short version, which book would be best? http://wiki.java.net/bin/view/Games/JavaGamingBooks 


Hey, I read through this form and I didn't see any flaming at all! What a succesful forum! While looking through I was looking for book suggestions (It's going to be my birthday soon Cheesy April 1st lol)
and I found some through the wiki.
http://wiki.java.net/bin/view/Games/JavaGamingBooks

I was really leaning toward the middle one ("Killer Game Programming") because the author keeps his website fresh with new chapters and content, you can tell he truelly wants people to learn from his book. I played the sample game of the bottom book ("Developing Games in Java"), but I wasn't all that impressed. And I have no clue about the top book. Anyone have suggestions?
Later on I will go into C++ and hopefully many other languages, ((C++) Which I've heard a million times is very similar to java) and I want to learn better ways to approach a problem. I have already finished a beginners book "Java 1.2 in 24 hours" (SAMS) and I have ("Java 2 Game Programming"), but it seems to be oriented to people that already know C++.

Thanks, also when I tested out some of ("Killer Game Programming in Java")'s programs they took ALONG time (few sec., but I have a fast comp.) to load, like the terrain or tree growing program, just wandering if all Java 3D is slow to load like that.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (48 views)
2014-04-15 18:08:23

BurntPizza (44 views)
2014-04-15 03:46:01

UprightPath (60 views)
2014-04-14 17:39:50

UprightPath (42 views)
2014-04-14 17:35:47

Porlus (58 views)
2014-04-14 15:48:38

tom_mai78101 (81 views)
2014-04-10 04:04:31

BurntPizza (140 views)
2014-04-08 23:06:04

tom_mai78101 (240 views)
2014-04-05 13:34:39

trollwarrior1 (200 views)
2014-04-04 12:06:45

CJLetsGame (207 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!