Monday, July 30, 2012

Re: ex large file

The desktop crashes, the process is killed, I think the OS did it.

- Enda


From: Ben Fritz <fritzophrenic@gmail.com>
To: vim_use@googlegroups.com
Cc: "vim@vim.org" <vim@vim.org>; Enda <enda_k2@yahoo.com>
Sent: Monday, July 30, 2012 5:54 PM
Subject: Re: ex large file

On Monday, July 30, 2012 11:12:08 AM UTC-5, Enda wrote:
> Is there a way to empty the contents of a large file? The below doesn't work:
>
>
> $ ex -s largefile -c '1,$d' -c wq 
>
> Killed
>
>
>
> - Enda

I haven't tried it but I think that should work.

What happens if you use "vim" instead of "ex -s"? Do you get an E340 for exceeding max file size (see :help limits)? When you say "doesn't work" and "killed" do you mean Vim crashes, or just seems to hang for a long time and then you gave up and terminated it?

Note, probably there are more efficient ways to truncate a file using external tools instead of a text editor. Maybe something like 'echo "" > filetowipe'?

No comments:

Post a Comment