硬盘活动 [英] hard disk activity
问题描述
我的任务涉及知道文件何时发生变化。但是对于小文件来说这是一个足够简单的任务,检查修改
日期,或者对内容进行比较,我需要能够做到这一点<对于非常大的文件,
。
Python中是否有任何可用的内容可以让我支持
检查硬盘本身或者,当发生
磁盘写入时,我的常规可以识别?
感谢您的帮助,
V
I have a task that involves knowing when a file has changed. But while
for small files this is an easy enough task, checking the modification
dates, or doing a compare on the contents, I need to be able to do this
for very large files.
Is there anything already available in Python that will allow me to
check the hard-disk itself, or that can make my routines aware when a
disk write has occurred?
Thanks for any help,
V
推荐答案
VSmirk:
我的任务涉及知道文件何时发生变化。但是对于小文件来说这是一个足够简单的任务,检查修改日期,
I have a task that involves knowing when a file has changed. But while
for small files this is an easy enough task, checking the modification
dates,
检查修改时间的工作方式是否相同大文件。为什么
不够好?
你的平台是什么?
-
$ b $bRenéPijlman
Checking the modification time works the same way for large files. Why is
that not good enough?
What''s your platform?
--
René Pijlman
我主要在Windows XP上工作,但我的解决方案需要跨越
平台。
问题是我需要的不仅仅是文件已经修改了b $ b。我需要知道该文件中的修改内容。
我需要同步远程文件夹上的文件和我目前的
解决方案,只是复制文件,如果日期比较或
内容比较,对于非常大的文件变得有点无法管理。
我正在使用的一些文件是数百个MB的大小,或者
更大。
所以我需要跳过复制一百个只有几个的MB文件
字节已更改,而是识别哪些字节已更改,以及
这些更改的位置。我在想一个模块在文件系统级别以下工作的价格低于b $ b,在设备级别,可能是一个地方来寻找解决方案。
I''m working primarily on Windows XP, but my solution needs to be cross
platform.
The problem is that I need more than the fact that a file has been
modified. I need to know what has been modified in that file.
I am needing to synchronize the file on a remote folder, and my current
solution, which simply copies the file if a date comparison or a
content comparison, becomes a bit unmanageable for very large files.
Some of the files I''m working with are hundreds of MB in size, or
larger.
So I need to skip copying a hundred MB file that has had only a few
bytes changed and instead identify which few bytes have changed and
where those changes are. I was thinking having a module that worked
below the file system level, at the device level, might be a place to
look for a solution.
" VSmirk" < VA ********* @ gmail.com>写道:
"VSmirk" <va*********@gmail.com> writes:
我需要同步远程文件夹上的文件,以及我目前的
解决方案,如果日期比较或内容比较,它只会复制文件对于非常大的文件来说有点难以管理。
我正在使用的一些文件大小为数百MB,或者更大。
I am needing to synchronize the file on a remote folder, and my current
solution, which simply copies the file if a date comparison or a
content comparison, becomes a bit unmanageable for very large files.
Some of the files I''m working with are hundreds of MB in size, or
larger.
为什么不看rsync程序:
http://samba.anu.edu.au/rsync/
但是对于那么多的数据,只是把它全部放在一个巨大的文件中不是
a如果你可以提供帮助,那就太棒了。也许您可以使用数据库。
Why don''t you look at the rsync program:
http://samba.anu.edu.au/rsync/
but for that much data, just plopping it all in a huge file is not
a great approach if you can help it. Maybe you can use a database instead.
这篇关于硬盘活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!