Marina JOSEPH

Greenhorn
+ Follow
since Feb 20, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marina JOSEPH

Hi all
I have a Java Socket Server side and Client Side programme.
Wanted to run some commands from as400 How?
20 years ago
Hi all
How to execute MAc OS commands to uisng Java
20 years ago
Hi all
How to execute windows commands to using Java
20 years ago
How to execute windows commands to using Java
20 years ago
how to create a batch file in unix?
like this way.
when i send a set of commands to unix
ls -ld
ls -la
ls
the unix automatically create a temporary file "abc" and stored
these commands, and after execute these commands to one bye one
and its result must be stored in a temporary file "abc.txt"
How?
20 years ago
import java.io.*;
class cmdEx
{
public static void main(String[] arg)
{
String str;
Process p;
BufferedReader in;
try
{
p = Runtime.getRuntime().exec("/bin/ls -aFl");
in = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((str = in.readLine()) != null)
{
System.out.println(str);
}
}
catch (IOException e)
{ System.out.println(e.toString()); }
}
}
message
c:\>java cmdEx
Error
java.io.IOException :CreateProcess :/bin/ls-aFl error=3
this can run p=Runtime.getRuntime().exec("java"); its working


but p=Runtime.getRuntime().exec("dir /p"); from windows.
again display the error
java.io.IOException :CreateProcess ir /p error=3
20 years ago
My server needs to perform System.Runtime.exec("ls") command. I need to capture the output from the command and send it back to client. How?
20 years ago
i want to develop 1 java application at server side. the server platform linux.
1 java application at client side the client platform windows.
i wanted to execute some commands from client side to the server.
give me the solution or examples
20 years ago
how can i send and receive data ,files,file search (using bytes array)using in java socket programming
plz analyse my problem & give a correct sugession and give any examples
my all the data stored in the server. and i wanted to see my all files,and using ls command
how i pass linux commands from client application to server.
plz analyse my problem & give a correct sugession
20 years ago
how to execute a linux or other os command using java socket?
read the length of the data into 4 byte, this is to make it platform independent.
In this method how to change to read the length of the data into 2 byte,
static final byte[] Read(BufferedInputStream inStream) throws Exception
{

byte[] pSize = new byte[4];
int nTotal = 0;
int nRead = 0;
while(nTotal<4)
{
nRead = inStream.read(pSize,nTotal,4-nTotal);
if(nRead<0) break;
nTotal += nRead;
}

int nSize = (pSize[0]&0x000000ff)|((pSize[1]&0x000000ff)<<8)|((pSize[2]&0x000000ff)<<16)|((pSize[3]&0x000000ff)<<24);

if(nRead<0||nSize<0) throw new Exception("Invalid input data");

// then read the actual data into a byte array

if(nSize==0) return "".getBytes();

byte[] pData = new byte[nSize];

nTotal = 0;

nRead = 0;
while(nTotal<nSize)
{
nRead = inStream.read(pData,nTotal,nSize-nTotal);

if(nRead<0) break;
nTotal += nRead;
}
if(nRead<0) throw new Exception("Invalid input data");
return pData;
}
for example,
In a Company named ABC have many clients. When the client requests to the webserver and he response to the client.
Then the client can access some data from his account.
All the data are stored in another Server. When the client can access his account, he request to the server to itsown port 1000 (store area server) and he response to the client request.
then after the response the client can access and or see the all the details about it.

Client request-> Webserver --Client request-> Data Server port 1000
<-response <-Server response
for example,
In a Company named ABC have many clients. When the client requests to the webserver and he response to the client.
Then the client can access some data from his account.
All the data are stored in another Server. When the client can access his account, he request to the server to itsown port 1000 (store area server) and he response to the client request.
then after the response the client can access and or see the all the details about it.

Client request->Webserver --Client request-> Data Server port 1000
<-response <-Server response
How to develop a protocol using java networking with thread.