[pLog-svn] File integrity check?
Mark Wu
markplace at gmail.com
Mon May 21 10:43:29 EDT 2007
I think it is a do-able way.
Here comes the prove of concept.
directoryToMD5Array() is a function that map a folder to an array
recursively
checkDirectoryMD5Array() is check the folder match the md5 array or not
So, the example here, it will:
1. Go through current directory and map all file & md5 hash value to $fils
array
2. serialize the arry to md5.txt
3. delete index.txt
4. load md5.txt and unserialize to md5_array
5. check the current folder again
6. print the remaining files
7. print the counter
I did not test it in lifetype, but I think it should work.
Mark
> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
> Sent: Monday, May 21, 2007 10:32 PM
> To: plog-svn at devel.lifetype.net
> Subject: Re: [pLog-svn] File integrity check?
>
> I suppose we should save the output of the md5 check
> somewhere - or perhaps have it as an option in the admin
> menu, so we can ask them to run it when they report the
> problem, rather than just in the wizard.
>
> On Mon, 21 May 2007, Oscar Renalias wrote:
> > Yes, I assume that there could be legitimate discrepancies
> between the
> > expected and actual results and that's why instead of
> showing an error
> > we should just show a warning. At that point it will be up to the
> > users to cancel the process and upload these files again or
> check that
> > the reported discrepancies match with files that they
> customized. If
> > they made no changes but still decide to go ahead despite the
> > warnings, we can always point this out when they complain in the
> > forums and nicely refuse to help them until they sort out the mess
> > with their files.
> >
> > On 5/21/07, Jon Daley <plogworld at jon.limedaley.com> wrote:
> >> On Mon, 21 May 2007, Oscar Renalias wrote:
> >>> I've recently noticed in the forums many weird issues related to
> >>> people uploading files incorrectly and/or FTP clients messing up
> >>> file uploads, which then caused LT to behave in "funny" ways.
> >> Yes.
> >>
> >>> I'm wondering if anybody has any idea about how we could detect
> >>> these situations.
> >> The only problem I see with your md5 idea is what about
> >> modifications they intended to make? I guess they could
> look at the
> >> list and decide whether they had modified them or not.
> >>
> >> I just checked the class and templates directory.
> The class
> >> directory took me 5 seconds to compute the sums, and the templates
> >> directory (including all 1.2 templates) took 15 seconds. It seems
> >> that my server is less loaded than most of the servers
> that we hear
> >> about on the forums.
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: md5check.zip
Type: application/octet-stream
Size: 5729 bytes
Desc: not available
Url : http://limedaley.com/pipermail/plog-svn/attachments/20070521/2fd20769/attachment.obj
More information about the pLog-svn
mailing list