This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes MDI file close. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "MDI file close." Watch "MDI file close." New topic
Author

MDI file close.

Sebin George
Greenhorn

Joined: Sep 17, 2004
Posts: 2
How can I know, is a file closed from a Multiple Document Interface(MDI)?

My idea is lock the file for that MDI and check to write that file from another java thread. If it is writable that file is been closed.

For that.

I am starting a process using the Runtime.


for example:

cmdArray[0]="C:\Program Files\TextPad 4\TextPad.exe";
cmdArray[1]="test.txt";
Process process=runtime.exec(cmdArray);

Now I want to give the FileLock to this process. Any way for doint that?

If i got any native code(windows) then also i'm happy.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

I don't think so (give the Runtime-process the lock).

But if you define a class as implementing Runnable, and that class has two goals:
a) handle the lock
b) start the Runtime-process.

would that solve your problem?


http://home.arcor.de/hirnstrom/bewerbung
Sebin George
Greenhorn

Joined: Sep 17, 2004
Posts: 2
with the thread lock how can I know an MDI is close? I don't find any logic for that..
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: MDI file close.
 
Similar Threads
Running Batch Files
Urgent - Need to add a menu into an MDI
Help needed for running for this runtime code
runtime.exec problems
Open a command prompt using Runtime.getRuntime().exec() and run a jar file