Copy open files?

  • Thread starter Thread starter jim
  • Start date Start date
Is there a way (using VB.Net or C#) to copy open or locked files?

Thanks!

jim

Hi,

No, if the file is locked by another process you cannot access it
 
That shows how to lock/unlock a file, not how to read an already
locked file (most probably locked in another process)

Yes, i just wanted to point out that he could unlock the file using
the code then he could copy it.

(PS: The thread is a cross-post)
 
kimiraikkonen said:
Yes, i just wanted to point out that he could unlock the file using
the code then he could copy it.

No you can't "unlock" a file "locked" by another process. Where "locked"
means opened exclusively, that is, non shared.
You can only use the "shadow copy services " to copy such file(s). The
shadow copy services API's aren't covered by the framework however.


Willy.
 
No you can't "unlock" a file "locked" by another process. Where "locked"
means opened exclusively, that is, non shared.
You can only use the "shadow copy services " to copy such file(s). The
shadow copy services API's aren't covered by the framework however.

Willy.

Willy,
The link i've posted claims that it locks and unlocks and updates the
same file under same application (under developer's application, even
can't get it worked such article). However there are some 3rd party
applications such as "Unlocker" which can unlock files locked by "any"
process . So that's another point of interest.

Plus it would be good to get a complete working code that locks and
unlocks and stores same file using FileStream class. The sample link
i've posted is not a well-explained one.

Thanks
 
Yes, i just wanted to point out that he could unlock the file using
the code then he could copy it.

(PS: The thread is a  cross-post)

Hi,

You can only unlock a file that you previously locked . Not only that,
but you must also use the same reference.
 
I am trying to write a simple backup program. I cannot find a backup
program that will sync directories across a lan, in a specific order, that
doesn't stop when (if) one synchronization fails because a PC is off or a
laptop has been removed from the network.

The directories need to be sync'd one at a time because of bandwidth
restrictions. The app should sync one directory at a time, skipping any
directories that cannot be sync'd because of any reason and it should send
an email (and provide a popup) stating any errors that were encountered.

I've seen and tested a great number of backup programs. But, most (a) are
too expensive fo what they do or (b) will not sync a number of folders if
any folder in the list errors without stopping the entire process.

These folders are very large (some 40GB) and the sync process should sync
one immediately after another in order to accomplish the sync within the 8
hours allotted for the task.

The data folders should not be in use at the time of synchronization, but
you never cantell what system process may have a file open (automatic
defrag, etc.) when it is time for it to be copied to its backup folder on
the server.

If I can pull it off, I will drop the app into open source for use by sys
admins everywhere.

Thanks again!

jim
 
One of the more perfect examples of what I'd like to accomplish is a product
called MirrorFolder (at http://www.techsoftpl.com/backup/features.php).

The "problem" with this software is the pricing per client instead of having
a server version that could be used to mirror all needed folders to itself.
(While I see this a a "problem", I do understand that the software's author
sees it as a money making proposition. If I could make a clone of his
software that did not exclude the use of network drives or mapped drives as
the source drive, I would make it freeware.)

jim
 
jim said:
One of the more perfect examples of what I'd like to accomplish is a
product called MirrorFolder (at
http://www.techsoftpl.com/backup/features.php).
The "problem" with this software is the pricing per client instead of
having a server version that could be used to mirror all needed
folders to itself. (While I see this a a "problem", I do understand
that the software's author sees it as a money making proposition. If
I could make a clone of his software that did not exclude the use of
network drives or mapped drives as the source drive, I would make it
freeware.)


Try LazyMirror. It rocks and the price is right.

http://www.xs4all.nl/~wstudios/LazyMirror/index.html
 
Back
Top