all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: md5 checksum of a img file, or get the value of 100th byte
Date: Sat, 07 Jun 2008 10:03:26 +1000	[thread overview]
Message-ID: <87myly3ycx.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: mailman.12802.1212782926.18990.help-gnu-emacs@gnu.org

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ted Zlatanov <tzz@lifelogs.com>
>> 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. 

Tim


-- 
tcross (at) rapttech dot com dot au


  parent reply	other threads:[~2008-06-07  0:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 11:29 md5 checksum of a img file, or get the value of 100th byte Xah
2008-06-05 19:17 ` Eli Zaretskii
     [not found] ` <mailman.12717.1212693595.18990.help-gnu-emacs@gnu.org>
2008-06-06 14:44   ` Ted Zlatanov
2008-06-06 16:33     ` Eli Zaretskii
     [not found]     ` <mailman.12786.1212770026.18990.help-gnu-emacs@gnu.org>
2008-06-06 18:55       ` Ted Zlatanov
2008-06-06 20:07         ` Eli Zaretskii
     [not found]         ` <mailman.12802.1212782926.18990.help-gnu-emacs@gnu.org>
2008-06-06 22:45           ` Ted Zlatanov
2008-06-07  6:34             ` Eli Zaretskii
     [not found]             ` <mailman.12833.1212820449.18990.help-gnu-emacs@gnu.org>
2008-06-09 15:04               ` Ted Zlatanov
2008-06-09 15:58                 ` Eli Zaretskii
2008-06-07  0:03           ` Tim X [this message]
2008-06-09 15:15             ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87myly3ycx.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.