From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: From: Daniel Bastos Date: Tue, 12 May 2015 11:17:54 -0300 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7b5db4aa764a780515e32b89 Subject: Re: [9fans] on cp /fd/1 /fd/0 Topicbox-Message-UUID: 527d7a10-ead9-11e9-9d60-3106f5b1d025 --047d7b5db4aa764a780515e32b89 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, May 12, 2015 at 9:24 AM, Iruat=C3=A3 Souza wr= ote: > --r-------- d 0 glenda glenda 0 May 10 18:57 0 > --rw------- d 0 glenda glenda 0 May 10 18:57 1 > ---w------- d 0 glenda glenda 0 May 10 18:57 2 > > is that what you want to know? or the reasons why the permissions are lik= e > that? > I want to understand the system. (It makes sense to me that the permissions are like that.) What is the relationship between file descriptor 1 and /fd/1? When a program runs, 1 is already open for writing. But apparently it's open only for writing. A read on it yields inappropriate use of fd. The same seems to happen /fd/1. Can I say they'll both always present the same behavior? I'm not able to change permissions on /fd/1. Why not? % ls -l /fd/1 ---w------- d 0 dbastos dbastos 0 May 19 2014 /fd/1 % chmod u+r /fd/1 chmod: can't wstat /fd/1: permission denied I'm studying. One thing I imagined was to write to standard output and be able to read what I wrote. --047d7b5db4aa764a780515e32b89 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= ue, May 12, 2015 at 9:24 AM, Iruat=C3=A3 Souza <iru.muzgo@gmail.com&= gt; wrote:
--r-------- d 0 glenda glenda 0 May 10 18:57 0
--rw------- d 0 glenda glenda 0 May 10 18:57 1
---w------- d 0 glenda glenda 0 May 10 18:57 2

is that what you want to know? or the reasons why the permissions are like = that?

I want to understand the system. (It makes sense to m= e that the permissions are like that.)

What is the relati= onship between file descriptor 1 and /fd/1? When a program runs, 1 is alrea= dy open for writing. But apparently it's open only for writing. A read = on it yields inappropriate use of fd. The same seems to happen /fd/1. Can I= say they'll both always present the same behavior?

<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">I'm not able to change permissions on /fd/1. Why not?
% ls -l /fd/1
---w------- d 0 dbastos dbastos 0 May 19 =C2=A02014 /fd/1
=

% chmod u+r /fd/1
<= div class=3D"gmail_default">chmod: can't wstat /fd/1: permission denied=

I= 'm studying. One thing I imagined was to write to standard output and b= e able to read what I wrote.
--047d7b5db4aa764a780515e32b89--