Solved

Copying locked files???

Posted on 2001-08-20
10
223 Views
Last Modified: 2012-05-04
Hi,

Is it possible to copy a file which another process as taken out a lock on? For example, MS Access locks all .mdb files when databases are open.

Strange question, I know... that's what locks are there for!! However, I'm writing a backup program and would very much like to backup these files, even when they are open. I only need read access to them.

Any ideas?
Kieran
0
Comment
Question by:dbaser
  • 2
  • 2
  • 2
  • +3
10 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6406439
>>Is it possible to copy a file which another process as
>>taken out a lock on?

You cannot (not in a reliable, documented way). Backup SW is supposed to run when nobody is using other programs...
0
 
LVL 32

Expert Comment

by:jhance
ID: 6406885
Whether you can read a locked file or not depends on how the "owner" of the lock has designed it.  If it's EXCLUSIVE then there is no way to do it since Windows prevents any other access.  Most backup SW that I've seen/used just reports those files that are locked since they cannot be backed up.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6407145
>>Most backup SW
>>that I've seen/used just reports those files that are
>>locked since they cannot be backed up.

That's why my backups are scheduled to run when I'm guaranteed not to be there and have files locked ;o)
0
 

Author Comment

by:dbaser
ID: 6407421
Spanx All,

Yep... that's what I figured alright.

Just wondering if anyone knew any sly ways around it!! :)

Thanks anyway,
Kieran
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 6408597
What platform are you use?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:dbaser
ID: 6409902
I'm using Windows 2000.

I've since seen a program advertised on the web called "Open File Manager". The blurb say that is "software that enables most backup software, including Windows 2000/NT backup, to capture open files during the backup/copy process - even if the files are changing."

http://www.gateway-websites.com/cgi-bin/ePages4.storefront/3b826642007d8382271dc0a80b6506f8/Export/products/112300-2D1001973

Anyone got any ideas how this works????
0
 
LVL 11

Expert Comment

by:griessh
ID: 6996402
Dear dbaser

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to

     "refund the points and PAQ at zero points"

since nobody had a satisfying answer for you.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 32

Expert Comment

by:jhance
ID: 6996412
I suggest you force accept jkr here.  His comment is both first and accurate.

I'll just point out again that SOMETIMES the correct answer is NO, IT CANNOT BE DONE.  Not liking the answer doesn't make it any less correct.
0
 
LVL 11

Expert Comment

by:griessh
ID: 6996535
Thanks for the feedback. I completely agree with your "NO" statement (jkr was my initial suggestion). What made me change my mind was the last question about "Open File Manager". But since there is proof that it really works, I guess you are right with jkr.

======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7011247
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now