How to manually unlock a (text) file from a program?

C

Camille Petersen

Sometimes there are programs which open a text file (e.g. a log file for writing something into it).
Unfortunately they do not release them but hold constantly a lock on these files until the
programs are closed.

Can I somehow detach/unlock the file lock e.g. by a command line command or other tool?

Do these programs stop working if they are de-coupled from their file?

Actually they could continue to write something into these log files.
Or are there any other reasons which let them crash?

Camille
 
R

R. McCarty

Why would you want to interfere with a normal process that uses
workspace files ? If you forcibly close the workspace files the
parent application is likely to fail or function incorrectly. Not sure
what your goal is. Most applications close their temporary files
when the program is closed. Any "Orphaned" files can usually be
cleaned up from the System/User temp folders just after a boot.
 
B

BillW50

In Camille Petersen typed on 29 Sep 2009 13:20:29 GMT:
Sometimes there are programs which open a text file (e.g. a log file
for writing something into it). Unfortunately they do not release
them but hold constantly a lock on these files until the
programs are closed.

Can I somehow detach/unlock the file lock e.g. by a command line
command or other tool?

Actually yes, Camille.

Unlocker
http://ccollomb.free.fr/unlocker/
Do these programs stop working if they are de-coupled from their file?

Actually they could continue to write something into these log files.
Or are there any other reasons which let them crash?

It depends on the program. But Unlocker can copy the file and you can
view that one without decoupling the original.
 
B

Bob I

Inline.


Camille said:
Sometimes there are programs which open a text file (e.g. a log file for writing something into it).
Unfortunately they do not release them but hold constantly a lock on these files until the
programs are closed.

That is becauee the program will be writing to it.
Can I somehow detach/unlock the file lock e.g. by a command line command or other tool?

Why would you want to close a file that a program is writing to?
Do these programs stop working if they are de-coupled from their file?
Yes.


Actually they could continue to write something into these log files.

Not if you crash the program.
Or are there any other reasons which let them crash?

Programs crash for various reasons.

Why not just copy the file of interest?
 
B

BillW50

In Bob I typed on Tue, 29 Sep 2009 08:42:33 -0500:
Inline.



That is becauee the program will be writing to it.


Why would you want to close a file that a program is writing to?


Not if you crash the program.


Programs crash for various reasons.


Why not just copy the file of interest?

Because Windows will not allow users to copy locked files normally. For
example, watch a youtube video with your browser and file exists in your
temp folder. But you can't copy it or anything. Close the browser
(either IE or Firefox works) and the file vanishes. So how do you save
it?

Unlocker
http://ccollomb.free.fr/unlocker/
 
J

Jim

Sometimes there are programs which open a text file (e.g. a log file for writing something into it).
Unfortunately they do not release them but hold constantly a lock on these files until the
programs are closed.

Can I somehow detach/unlock the file lock e.g. by a command line command or other tool?

Do these programs stop working if they are de-coupled from their file?

Actually they could continue to write something into these log files.
Or are there any other reasons which let them crash?

Camille

What exactly are you trying to do ?
 
J

Jose

Sometimes there are programs which open a text file (e.g. a log file for writing something into it).
Unfortunately they do not release them but hold constantly a lock on these files until the
programs are closed.

Can I somehow detach/unlock the file lock e.g. by a command line command or other tool?

Do these programs stop working if they are de-coupled from their file?

Actually they could continue to write something into these log files.
Or are there any other reasons which let them crash?

Camille

It sounds like you are describing files that are in use which will
prevent modification/deletion as long as the application is running
and using them.

The log for the Windows Task Scheduler (SchedLgU.txt) is a good
example (lots of Windows log files). You can read it, but you can't
modify or delete it until the Task Scheduler service is stopped. You
can open the file, copy/paste the contents to another file. Some log
files can't even be opened for reading while they are in use. This is
by design and not indication of an issue that needs attention.

This is not the same as a file that is read only or not properly
released when a program ends. A user may also be prevented from
tampering with a file through restrictions/permissions or the file may
not allow simultaneous modification from more than one source.

You can download third party tools for stubborn files that will delete
them using methods that are generally already available to you through
the Windows GUI. Looks like magic, but it's not really. It is just
more convenient and usually faster than trying to figure it out
yourself. You have also added another program to your system just to
delete a stubborn file, which you can always uninstall later if you
want, and you introduce the potential for malicious software to be
installed on your system.

If something is crashing, hopefully you will try to fix it.

What is the file(s) you are interested in and what are the messages
you see and we can tell you what is going on and provide the most
appropriate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top