9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: sqweek <sqweek@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] <> operator
Date: Wed, 23 Sep 2009 01:06:39 +0800	[thread overview]
Message-ID: <140e7ec30909221006l38e4ead7y7192d5607f04f316@mail.gmail.com> (raw)
In-Reply-To: <a560a5d00909170545r53e0f5d5if0545f741fa508e8@mail.gmail.com>

2009/9/17 Rudolf Sykora <rudolf.sykora@gmail.com>:
> Hello,
>
> is the <> operator a feature only of native plan 9?
> It doesn't seem to work for me in p9p...
> Is the right solution then, instead of
>
> program <> file
>
> write
>
> program < file > file_tmp
> mv file_tmp file

 It works fine in p9p, however it doesn't do what you want it to do.
<> opens a file for reading and writing, on a single file descriptor
(default 0 iirc). You can then duplicate that to stdout (>[1=0]) so
the process is reading and writing to the same file, but I'd be very
surprised if that satisfies your requirements.
 The tmp file trick is the most reliable idiom for this task, as far
as I'm aware.
-sqweek



      reply	other threads:[~2009-09-22 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 12:45 Rudolf Sykora
2009-09-22 17:06 ` sqweek [this message]

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=140e7ec30909221006l38e4ead7y7192d5607f04f316@mail.gmail.com \
    --to=sqweek@gmail.com \
    --cc=9fans@9fans.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).