• Post Reply Bookmark Topic Watch Topic
  • New Topic

a newbe question

 
Marek Szczypinski
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use in my JAVA application a C popen function. It returns a pointer to the FILE structure. How should I do it, or is there a symilar method in JAVA? Thanx in advance.
markacy
 
Seb Mathe
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know the C popen function, but have a look at the java.io and java.nio packages, ther's a lot of classes for manipulating files (FileChannel, RandomAccessFile, ...)
 
Henry Wong
author
Sheriff
Posts: 22530
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The closest method call to the popen() function, is probably Runtime.getRuntime().exec(). You will get a process object back. They object will also give you access to the streams of the process -- much like popen() will give you a pipe to the external process.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!