Search for AVI file?

Peter Kleiweg in.aqua.scribis at nl.invalid
Mon Aug 30 16:12:04 EDT 2004


John Doe schreef:

> I realise that this is not really a python question, but python's the
> only language I'd be comfortable trying to deal with this.
>
> What I need is to search a drive and find all the AVI format files
> that are NOT listed with the AVI extension.  I'm looking over an old
> drive of mine from an old computer.  I know the files were renamed
> with the wrong extension, but I know that they were originally AVI
> files.  Can python do this for me?  Any hints?  Anybody have a link to
> something that would already do this?  I appreciate any help.

Use walk() to find all files. Open each file and read in the
first 12 bytes. The last four of those 12 bytes should be
'AVI ', if I'm not mistaken.

-- 
Peter Kleiweg  L:NL,af,da,de,en,ia,nds,no,sv,(fr,it)  S:NL,de,en,(da,ia)
info: http://www.let.rug.nl/~kleiweg/ls.html

The Halloween Documents: http://www.opensource.org/halloween/




More information about the Python-list mailing list