read the contents of ISO?

edited October 2013 in How To...

HI, there is a library for reading the contents of a file, ISO?

Tagged:

Answers

  • edited October 2013 Answer ✓

    Hi! :) Unfortunately I don't know.

    Very often I see question about "is there a library to do X". Sometimes there is, but I wanted to point out that in case it doesn't exist, you have access to ALL the command line programs in your operating system. There are thousands, to do all kinds of things. Maybe you knew this already. But for those who don't, you can access any command line program from Processing like this:

    import java.io.InputStreamReader;
    
    try {
      Process p = Runtime.getRuntime().exec(new String[] {"ls", "-la"});
      p.waitFor();
    
      BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
      String line;
      while ( (line = input.readLine ()) != null) {
        println(line);
      }
      input.close();
    } 
    catch(Exception e) {
      println(e);
    }
    

    And if you don't care about the output of the program you can remove the import and the lines with "input".

    This little program would call "ls", which lists the files in a folder, with the argument "-la", which shows more details about those files.

    In your case, you could replace "ls" and "-la" by a command line program that does ISO file manipulations (for example to list the content of the ISO file, or to extract specific files). For instance, in Windows you could call this http://poweriso.com/tutorials/extract-iso-file-on-command-line.htm (I have never tried this, I don't know if it's any good).

  • edited October 2013

    HI, hamoid:

    I tried what you said, from windows cmd, it works:

    C:\Program Files\PowerISO>piso list d:\CD\ONLINE.iso /


    from Processing, only managed to run the program, but I can not enter command

              Process p = Runtime.getRuntime().exec(new String[] {"C:\\Program Files\\PowerISO\\piso.exe", "list"});
    

    -------------------------------------------------------------/

    PowerISO Version 5.7 Copyright(C) 2004-2013 Power Software Ltd

            Type piso -? for help
    

    Bad parameter: list

  • HI dimkir:

    I do not understand how it works, or how to install these libraries, you have worked with these libraries? example plz

  • edited October 2013
    String cmdArray[]={"C:\\Program Files\\PowerISO//piso","list","D:\\CD\\ONLINE.iso","/"};
      Process p = Runtime.getRuntime().exec(cmdArray);
    

    the problem is the last parameter, I do not recognize it, it does nothing "/"

  • LOl..........work!!!!!!!

    delete this line p.waitFor();

    import java.io.InputStreamReader;
    
    try {
    
     String cmdArray[]={"C:\\Program Files\\PowerISO//piso","list","D:\\CD\\ONLINE.iso","/"};
     Process p = Runtime.getRuntime().exec(cmdArray);
     BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    
      String line;
      while ( (line = input.readLine ()) != null) {
        println(line);
      }
      input.close();
    }
    catch(Exception e) {
      println(e);
    }
    
  • Awesome :) Since it's working, you can mark the question as answered in this forum. Cheers!

  • edited October 2013

    (posted twice)

  • maybe someone can tell me of any library, to resolve this. sorry for my requirements.

Sign In or Register to comment.