Skip to content

Feature: Add 'File' support that can cross the curly-block barrier #26

@aghast

Description

@aghast

Presently, the grammar supports redirection using hard-coded numbers, nothing else.

{ foo 2> error.log }

Notably, there is no mechanism for variable expansion within a redirection:

{ foo $out_fh> error.log }

In addition, there does not appear to be a way to pass file across the {}-barrier from "hush code" to "command code". For example, there isn't a way to open a file, advance to a particular offset, then begin writing to that position in the file from a command block:

fh = fopen('some_file.txt')
fseek(fh, 100)
{ foo > $fh }

Note:

This seems like an obvious "new type". It might be a dictionary wrapped around something (a bunch of methods, plus some internal data like fileno or something), but it kind of sets the stage for "How do you add new types that require compiled code for support?" So that is probably an important question to answer, too!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions