Hi,!_NEWLINE_! We are developing a solution for a client part...
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ryan_Lemos
Posted On:   Saturday, February 3, 2001 06:57 PM

Hi, We are developing a solution for a client part of which requires our java code to run on AS 400. Part of the solution requires us to poll on the /qdls/.... directory, as well as read and write files to that directory. The clients have an existing application that uses the same directory. We are able to access that directory from the main thread, however any threads spawned by the main thread cannot access the same. When the code listed below is run - it simply verifies the existence of the directory - it returns a true for the check from the main thread but a false for the check from the spawned thread. Now this behavior is only with the /qdls directory and any below it, and not with any directories that we create. On checking the mode of the qdls direc   More>>

Hi,
We are developing a solution for a client part of which requires our java code to run on AS 400. Part of the solution requires us to poll on the /qdls/.... directory, as well as read and write files to that directory. The clients have an existing application that uses the same directory. We are able to access that directory from the main thread, however any threads spawned by the main thread cannot access the same. When the code listed below is run - it simply verifies the existence of the directory - it returns a true for the check from the main thread but a false for the check from the spawned thread. Now this behavior is only with the /qdls directory and any below it, and not with any directories that we create. On checking the mode of the qdls directory it was listed as rwx---rwx. We tried changing the mode of any of the directories we created to the same to see if the same happens with those directories, but could not reproduce the same behavior. The version we are using is V4R5 and the java version is 1.1.8. As neither us nor out clients have extensive expertise on AS 400 we are at a loss as to what could be the reason behind this behavior. Any suggestions as to how we may resolve the same would be much appreciated. Please find the sample code listed below:
thanks,
Ryan Lemos

public class Threadtest extends Thread
{
// static String path="/home/00101/";
static String path="/qdls/";

public Threadtest()
{}

public static void main(String args[])
{
File fileObj = new File(path);
try
{
System.out.println("In the main dir exists is
"+fileObj.exists());
Thread.sleep(1000);
(new Threadtest()).start();
}
catch(Exception e)
{
System.out.println(e);
}
}
public void run()
{
File fileObj = new File(path);
try
{
System.out.println("In the thread dir exists is
"+fileObj.exists());
}
catch(Exception e)
{
System.out.println(e);
}
}
}

   <<Less
About | Sitemap | Contact