954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

if a file is still open by another program

Any idea how to check if a text file is still being opened by another program??

I wanted to write to the file after the other program had finished its task and closed the text file. As i know two programs cant open the same file at the same time.

integer*09
Light Poster
40 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

There really is no way to tell if the file is still opened other than attempt to open it in your program. If open fails, wait a little bit then try again. stay in that loop until open succeeds or some timeout value expires.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Two programs can open the same file at the same time - at least in M$ world at the command line interface.

In the Windows world, you might need to use something like this in order to enforce access restrictions to an open file.

vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228
 

Thanks both AD and vmanes for your informative reply.

integer*09
Light Poster
40 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

First, sorry for my bad english. I'm from Ecuador and I speak spanish.
Now, open notepad or notepad++ and write the configuration that you need, then save as NSC.ini in the desktop of your PC, then copy and replace the file in C:/File Programs/NSCliente ++ directory
and is solved...

enriquezrene_ap
Newbie Poster
1 post since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You