How to detect creation of a file...

10-11  Source: Network gathering  Views:0 

Advertisement
Hi ,
I am trying to call a command line application within a java file. Its working fine by using Process.getRunTime() method. But the problem is... I need to do this a couple of times in my program. one file will be generated in the first phase,... and this will be given as input to the next command. And I am not able to find out when the file is created. If I am trying to access that file (for chekin using -- "file.exists()" ), it is not created, it is getting created only after I quit from the program. But on the other hand, if I leave the program without accessing that file, it will be created even i=when the program is running. Is there any solution for this prob>
thanx in advance,
Hi,
Thanx for ur help... but I am not creating file in my program. It is created by the command line program that I am using. I am including my program.
import java.io.*;
import java.lang.*;
public class test
     public static void main(String s[])
          try
               Process proc = Runtime.getRuntime().exec(command);
/* "command" is the command line program I'm using... it creates req
file - opFile     */
               File tempf=new File("E:/" + opFile);
               while(!tempf.exists())
                    Thread.sleep(3000);
               System.out.println("File Created");
          catch(Exception e){}
Thanx for all your help.
Related articles
  • How to detect creation of a file... 10-11

    Hi , I am trying to call a command line application within a java file. Its working fine by using Process.getRunTime() method. But the problem is... I need to do this a couple of times in my program. one file will be generated in the first phase,...

  • How to avoid creation of _(file.*), coping from tiger to pc? 10-11

    how to avoid the creation of this file for ever on a pc environment?? I explain: as i copy any image file, it goes to a spooler directory and that begins instantly to process the file to an OPI server, separating CMYK channels, converting it to high

  • How to disable creation of ".bak" files when saving? 10-11

    Every time I save a project a xxxxx.jws.bak file is created. How can I disable this? i found no option in the preferences dialog Peter...no answer?Read other 2 answers

  • How to detect the end of a loaded swf file 10-11

    Hello Guys This is my first time on this forum, come here with a great hope I have loaded a picture file (jpeg) and a video file (swf) into the main flash file using xml on frame 3, I load the picture and on frame 7, I load the video, there is a stop

  • How to detect encoding file in ANSI, UTF8 and UTF8 without BOM 10-11

    Hi all, I am having a problem with detecting a .txt/.csv file encoding. I need to detect a file in ANSI, UTF8 and UTF8 without BOM but the problem is the encoding of ANSI and UTF8 without BOM are the same. I checked the function below and saw that AN

  • How to detect JRE with Javascript and without any help of class file 11-30

    Please tell me how to detect JRE with using the Applet file. Is it possible to detect only through JavascriptIt is possible to detect the Sun JRE using only Javascript without any class file. However, it is rather complicated due to difficulties with

  • How can detect and remove scanned white pages in an OCRd pdf file? 11-30

    How can detect and remove scanned white pages in an OCRd pdf file?Acrobat does not support an automated way of doing this directly. You can remove completely blank pages (pages that don't have any "marking objects"), but a scanned page does cont

  • How can you detect (from a script file) that javac found problems? 10-11

    The subject line says it all, but the background is: I have a script file (.bat, since am stuck on windoze for the moment) which is doing some compilation using javac. I would like to skip all subsequent activities in the script file after the call t

  • F110 - How to prevent multiple creation of DME file? 10-11

    Hello, I need to prevent multiple creation of DME file for the same Payment Run (after it has been created once). "Printout" bottom creates DME file and Payment Advice any time you trigger it. I'm searching for some User Exit / BAdi / Function t

  • F110 - How to prevent the creation of DME file in Proposal Step 10-11

    Hello, I would like to prevent the creation of DME file in Proposal Step of Payment Run (F110). Is it possible to suppress "Create Payment Medium" checkbox? Many ThanksIf you are using the Payment Medium Workbench, there is perhaps a solution: I

  • How do I eliminate the use and creation of big files in the profile - places.sqlite, urlclassifier3.sqlite, places.sqlite-wal? 10-11

    I want to eliminate the use and creation of big files in the profile - places.sqlite (10MB), urlclassifier3.sqlite (5MB), places.sqlite-wal (1MB)? Ffor urlclassifier, I tried disabling safebrowsing options (in security menu or in about:config), but f

  • Acrobat 8.1 and C# - How can you detect password protected PDF files? 10-11

    I am modifying our existing C# code that opens PDF files.  But when ever we hit a password protected file, we are prompted for a password.  This is an automated process, so if we detect a password protected file, we move the file to a manual processi

  • How to find creation date of a file in RHEL 5 10-11

    We have instances having RHEL 5.10 in our setup. The file system type shown using df –T says that file system type is ext3.  The ls –ltr command seems to show the modification time but not created date. I hope my question is clear on how to find the

  • ANSWER: HOW TO DETECT Java Plugin from JavaScript 10-11

    I created a new topic because the questions about how to detect Java Plugin in browsers are scattered thoughout this forum. Basically you need to employ two approaches for IE and NS. In IE you need to try to instantiate a small applet (not your produ

  • Issue in Creation of XML file from ABAP data 10-11

    Hi, I need to create a XML file, but am not facing some issues in creation of XML file, the in the required format. The required format is -<Header1 1st field= u201CValueu201D 2nd field= u201CValueu201D>    - <Header2 1st field= u201CValueu201D 2

  • Creation of  .ard file 10-11

    hi all, Can any body Suggest me regarding my .ard file creation . i am doing like this to create .ard file ie E:\Program Files\SAP\SAP Business One SDK\Tools\AddOnRegDataGen i am going this  and creating my .ard file r else any other way to Create .a

  • How to detect USB Flash Drive name in LabVIEW 10-11

    Hi there I was looking for how to detect a USB Flash Drive name in Labview appearently every time i insert USB Flash Drive in a computer, windows assign it a different name once "J:" and sometimes "M:" Is there anyway to obtain USB Fla

  • How to detect the path of Temp directory 10-11

    I am writing a class library which allows users to manipulate a database in the web server java applications/applets. In my logic the Application/Applet communicate with a CGI script/Servlet in the server and that do all the database handling. My obj

  • How to detect color pages in a PDF? 10-11

    I am using a C++ Acrobat plug-in do read/edit a PDF file. I need to get the total number of pages in the PDF as well as the page numbers of color pages. So far I have been able to get the total number of pages using PDDocGetNumPages() without any tro

  • How to detect is flash player is idle 10-11

    How to detect whether flash player is playing any animation like moving an object or it is static like an image for .swf file. I want to know the duration of the .swf file played.is is as2, yes I have to detect animation duration achieved via action