Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: reading a file into an array. mapfile? (f)?
- X-seq: zsh-users 13269
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Rocky Bernstein <rocky.bernstein@xxxxxxxxx>
- Subject: Re: reading a file into an array. mapfile? (f)?
- Date: Sat, 20 Sep 2008 13:29:07 -0700
- Cc: Peter Stephenson <pws@xxxxxxx>, zsh users mailing list <zsh-users@xxxxxxxxxx>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=d200807; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=zi9YDnJJSiFWjon56PybKJYN4TmAIG7GoO30wWcjLlXHDQxFPCU/T6jh3ISAdqJcGcGZupAtS2zuOkWaX48D+o5N/hWTaaZdBxEMe4nzXKbHm5cYaltTZoEQlH6r0kA3ChH2bO2f+dEICopyUZjJdnn7Blxbg5xckDhsK0oYIH8=;
- In-reply-to: <6cd6de210809190744y38654349qa0db6e4d4b8fc2a5@xxxxxxxxxxxxxx>
- Mail-followup-to: Rocky Bernstein <rocky.bernstein@xxxxxxxxx>, Peter Stephenson <pws@xxxxxxx>, zsh users mailing list <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210809171953pd956d75gd4b3609ac036fe0@xxxxxxxxxxxxxx> <080917214418.ZM27616@xxxxxxxxxxxxxxxxxxxxxx> <6cd6de210809181747kc0f0a5bt4489f534589725a8@xxxxxxxxxxxxxx> <20080919100725.5c471019@news01> <6cd6de210809190339g57a4e722u5ad1371e858c8501@xxxxxxxxxxxxxx> <200809191100.m8JB0sAC028936@xxxxxxxxxxxxxx> <6cd6de210809190744y38654349qa0db6e4d4b8fc2a5@xxxxxxxxxxxxxx>
On 2008-09-19 at 10:44 -0400, Rocky Bernstein wrote:
> So now with this, file listing (the "list" command) is now in the debugger.
> Down the line, file information should be kept. Most important would be
> modification time and some sort of checksum (or "cryptographic")
> information. Too bad this isn't already in the zsh/files module.
Mod-time you get from zsh/stat.
You probably want to avoid loading the 'stat' built-in name, since
nowadays that's an external command with different behaviour, but:
zmodload -aF zsh/stat b:zstat
will get you 'zstat', same behaviour.
% zstat -H foo src
% print ${(k)foo}
blksize nlink size rdev mode mtime inode blocks device atime uid link ctime gid
% print $foo[mtime]
1220980489
% zstat -sH foo src
% print $foo[mtime]
Tue Sep 9 10:14:49
Cryptographic, I'm more cautious of, as the cryptographic libraries tend
to be fairly large and the ABI compatibility awkward. Having an
external command seg-fault because the version of OpenSSL it's loading
doesn't match the version it was linked against is one thing. Having
your shell seg-fault and die when a module is loaded or you run a
command is another.
While zsh could just implement certain checksum algorithms internally,
picking which ones are "safe" is a cryptanalysis job and the sort of
thing we should stay away from, as the decisions made would last for
years (measured in decades, probably).
IMO adding cryptographic support to the shell would be into the area of
bloat; zsh is still a Unix shell and still well suited to running
external commands.
Is there a reason that a single fork/exec to get a checksum is a problem
(besides worrying about the portability of the checksum commands used)?
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author