在使用备份文件被另一个进程 [英] Backup Files in use by another Process

查看:183
本文介绍了在使用备份文件被另一个进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序目前使用第三方API,它有一个错误迫使我在32位来构建它。不幸的是这与窗口的卷影复制,因为这显然是必须在64位上运行的工作相冲突。

My application currently uses a third party API that has a bug forcing me to build it in 32bit. Unfortunately this conflicts with Window's Volume Shadow Copy as this apparently must be run in 64bit to work.

在那里VSS目前正在由另一进程使用任何替代方案,我可以用它来安全地备份文件?

Are there any alternatives to VSS I can use to safely backup files that are currently being used by another process?

推荐答案

根据您的requiremen你可以做一些简单的这样的:

Depending on your requiremen you can do something as simple as this:

FileStream fStream = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader FileReader = new StreamReader(fStream, Encoding.UTF8);

这将工作在一些situtions,因为它可以读取锁定的文件。但我强烈建议您先弄清楚你的要求,并张贴在这里。

This will work in some situtions, as it can read locked files. But i strongly recommend that you figure out your requirements first and post here.

IE浏览器,我们谈论的有写信给他们的随机位置的数据2GB的文件吗?或每一个现在,然后被追加新的数据2MB日志文件?

IE are we talking about 2gb files that have data written to them in "random" locations? Or 2mb log files that are appended with new data every now and then?

这篇关于在使用备份文件被另一个进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆