Access files in use
-
Is there a way to access files that are currently in use by another program? I am sure that there is because backup utilities do it all the time, but I just have no idea how to do it. I would really appreciate any help. Thanks
-
Is there a way to access files that are currently in use by another program? I am sure that there is because backup utilities do it all the time, but I just have no idea how to do it. I would really appreciate any help. Thanks
It depends on the share locks. If a program locks the file for writing, then other programs can read it. If it locks it for reading, the other apps may be able to write to it. If it's locked for both (exclusive), then you'll have to wait. See the documentation for
FileStream
class in the .NET Framework, which includes samples. Also see theFileShare
enumeration documentation as well. Backups are an entirely different story and this is a very low-level feature. Also, backup accounts typically (and should) have the backup security privilege that lets those accounts do much more than allowed by other accounts (including administrative accounts if they don't have those privileges.Microsoft MVP, Visual C# My Articles