bug-bash
[Top][All Lists]
Advanced

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

Re: "here strings" and tmpfiles


From: Chet Ramey
Subject: Re: "here strings" and tmpfiles
Date: Wed, 10 Apr 2019 08:49:01 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/9/19 1:03 AM, pepa65 wrote:

> I think Linda's main drive is to seek improvement in how bash works. Now
> that lack of memory is in no way a constraint for the vast majority of
> situations where bash is commonly used, it would be great if that memory
> could be used instead of writing to a file system -- whether a pipe, a
> here doc/string does that, or explicitly through redirection. Things
> could work without requiring the presence of a file system.

There is no portable way to turn an arbitrary block of memory into a file
descriptor. There are mmap-based approaches that can get you most of the
way there, but they require a file descriptor to start with.

You can always invent some kind of local IPC that uses memory buffers, but
the implementation cost of doing that outweighs the benefit.


> If temporary files are not created in all cases of here docs/strings, it
> would be great if the buffer size that bash allocates could be set.

Some systems allow the pipe buffer size to be set, but that's not portable
either.

> Bash not writing temporary files for here strings & docs would be a
> great feature to me.

Look at the devel branch.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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