[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: md5 checksum of a img file, or get the value of 100th byte

From: Tim X
Subject: Re: md5 checksum of a img file, or get the value of 100th byte
Date: Sat, 07 Jun 2008 10:03:26 +1000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Ted Zlatanov <address@hidden>
>> Date: Fri, 06 Jun 2008 13:55:18 -0500
>> EZ> ??? insert-file-contents already can read only a portion of a file.
>> EZ> See its doc string.
>> I know about that.  I'd like to be able to open a 1 GB file in Emacs and
>> view just a piece at a time, in a sliding window.  I am not aware of
>> functionality to do this
> For viewing such a file, it should be easy to write some Lisp using
> insert-file-contents to read a file one chunk at a time.  For editing,
> I submit that there should be no reason to edit such large files.
A few years ago, I would have totally agreed. However, I'm frequently
coming across files larger than 1Gb that need editing. I will admit that
when I've needed to do this, the editing has been pretty
straight-forward and I've used sed to do it instead of trying to use an
editor. For example, I regularly need to edit large (multiple gigabyte)
Oracle database files in order to change some control information so
that the files can be loaded into a different database instance. While
Oracle now does have things like cloneing and hot backups that can
handle this sort of requirement more efficiently, sometimes it is still
required to do it manually. 

My point is that I'm encountering situations in which files are 1Gb and
larger an they need text to be changed and that these days, editing of
1Gb files isn't as odd a requirement as it use to be. However, the
extent to which you need an editor like emacs to do this is probably
still questionable. My experience is that utilities like sed, awk, perl
and other scripting languages can probably handle most
cases. Unfortunately, it is becoming rare that people even seem to know
about things like sed/awk and therefore turn to something like emacs or
vi to solve heir problem. 

To the OP, I don't understand why you would be using emacs for the job
you describe. sometimes I think people are trying to use emacs for the
wrong tasks. Its a great editor with wonderful support for configuration
and customization, but it is primarily an editor, not a full blown
programming environment. It sounds like using existing utilities to
create unique signatures would be far more efficient and less time
consuming. For example, you could solve yor problem in just a few lines
of perl code. My recommendation would be to use Emacs to write the perl
code, but let perl do the task of generating unique sigs from either the
image file data or the path/name information for the file. 


tcross (at) rapttech dot com dot au

reply via email to

[Prev in Thread] Current Thread [Next in Thread]