Topic: Feedback to n3940 [Filesystem]


Author: Markus Mayer <lotharlutz@gmx.de>
Date: Sun, 15 Jun 2014 13:50:48 +0200
Raw View
This is my feedback to n3940 [Filesystem]. If this is not the right
list, please direct me to the correct one.

- File permissions:
I want to be able to check if I (= the user under the application is
running) have read (or write (inclusive read-only flag)) permissions to
a specific file.

The proposal contains a way of retrieving the access rights for the
owner, group and others. But there is no way to get the username or
group memberships of the current user.


- Add Path to file stream constructors:
The proposal states: "[Note: Conversion to string_type is provided so
that an object of class path can be given as an argument to existing
standard library file stream constructors and open functions. This
provides basic interoperability without the need to modify existing
standard library classes or headers. --end note]"

I think these are only small modifications to the existing standard and
makes the usage more easy. Furthermore specifying a file with a
Path-Object is more natural than a String-Object, imho.

- Some clarifications:
path("\\server\share\path\filename").root_name() returns "\\server\share"?

Do I have to prepend "\\?\", if I have a path longer then 256 (on Windows)?

On Posix systems there is no way to create a path p, with
!p.has_root_name && p.has_root_directory?

regards,
   Markus

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Olaf van der Spek <olafvdspek@gmail.com>
Date: Sun, 15 Jun 2014 06:02:48 -0700 (PDT)
Raw View
------=_Part_393_18989900.1402837368889
Content-Type: text/plain; charset=UTF-8

On Sunday, June 15, 2014 1:50:51 PM UTC+2, Markus Mayer wrote:
>
> - File permissions:
> I want to be able to check if I (= the user under the application is
> running) have read (or write (inclusive read-only flag)) permissions to
> a specific file.
>

Why?
What about just opening the file?

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_393_18989900.1402837368889
Content-Type: text/html; charset=UTF-8

<div dir="ltr">On Sunday, June 15, 2014 1:50:51 PM UTC+2, Markus Mayer wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">- File permissions:
<br>I want to be able to check if I (= the user under the application is
<br>running) have read (or write (inclusive read-only flag)) permissions to
<br>a specific file.
<br></blockquote><div><br></div><div>Why?</div><div>What about just opening the file?</div><div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

------=_Part_393_18989900.1402837368889--

.


Author: Markus Mayer <lotharlutz@gmx.de>
Date: Mon, 16 Jun 2014 21:14:03 +0200
Raw View
On 06/15/2014 03:02 PM, Olaf van der Spek wrote:
> On Sunday, June 15, 2014 1:50:51 PM UTC+2, Markus Mayer wrote:
>
>     - File permissions:
>     I want to be able to check if I (= the user under the application is
>     running) have read (or write (inclusive read-only flag)) permissions to
>     a specific file.
>
>
> Why?
> What about just opening the file?
>

Being unable to open a file, can have multiple reasons:
- File not present
- Access denied
- Device not available
- ...

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Thiago Macieira <thiago@macieira.org>
Date: Mon, 16 Jun 2014 12:28:24 -0700
Raw View
Em seg 16 jun 2014, =E0s 21:14:03, Markus Mayer escreveu:
> On 06/15/2014 03:02 PM, Olaf van der Spek wrote:
> > On Sunday, June 15, 2014 1:50:51 PM UTC+2, Markus Mayer wrote:
> >     - File permissions:
> >     I want to be able to check if I (=3D the user under the application=
 is
> >     running) have read (or write (inclusive read-only flag)) permission=
s
> >     to
> >     a specific file.
> >=20
> > Why?
> > What about just opening the file?
>=20
> Being unable to open a file, can have multiple reasons:
> - File not present
> - Access denied
> - Device not available
> - ...

On POSIX systems, the actual filesystem operations are done using the hidde=
n=20
"FSUID" of the running program, which is usually the same as the EUID. That=
=20
means programs might be able to open files that they shouldn't open. That's=
 why=20
there's an access(2) call that check whether the real UID of the current=20
process could open the file.

Are you asking for a function similar to access(2)?
--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: Olaf van der Spek <olafvdspek@gmail.com>
Date: Mon, 16 Jun 2014 21:35:06 +0200
Raw View
On Mon, Jun 16, 2014 at 9:14 PM, Markus Mayer <lotharlutz@gmx.de> wrote:
>> Why?
>> What about just opening the file?
>>
>
> Being unable to open a file, can have multiple reasons:
> - File not present
> - Access denied
> - Device not available

Yes, and the error code tells you why, right?


--
Olaf

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Markus Mayer <lotharlutz@gmx.de>
Date: Mon, 16 Jun 2014 22:08:30 +0200
Raw View
On 06/16/2014 09:28 PM, Thiago Macieira wrote:
> Em seg 16 jun 2014, =E0s 21:14:03, Markus Mayer escreveu:
>> On 06/15/2014 03:02 PM, Olaf van der Spek wrote:
>>> On Sunday, June 15, 2014 1:50:51 PM UTC+2, Markus Mayer wrote:
>>>      - File permissions:
>>>      I want to be able to check if I (=3D the user under the applicatio=
n is
>>>      running) have read (or write (inclusive read-only flag)) permissio=
ns
>>>      to
>>>      a specific file.
>>>
>>> Why?
>>> What about just opening the file?
>>
>> Being unable to open a file, can have multiple reasons:
>> - File not present
>> - Access denied
>> - Device not available
>> - ...
>
> On POSIX systems, the actual filesystem operations are done using the hid=
den
> "FSUID" of the running program, which is usually the same as the EUID. Th=
at
> means programs might be able to open files that they shouldn't open. That=
's why
> there's an access(2) call that check whether the real UID of the current
> process could open the file.
>
> Are you asking for a function similar to access(2)?
>

I don't mean a function similar to access. Just: Is writing to this file=20
possible?

If you have to handle EUID/UID, you have to care anyway.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: Markus Mayer <lotharlutz@gmx.de>
Date: Mon, 16 Jun 2014 22:13:35 +0200
Raw View
On 06/16/2014 09:35 PM, Olaf van der Spek wrote:
> On Mon, Jun 16, 2014 at 9:14 PM, Markus Mayer <lotharlutz@gmx.de> wrote:
>>> Why?
>>> What about just opening the file?
>>>
>>
>> Being unable to open a file, can have multiple reasons:
>> - File not present
>> - Access denied
>> - Device not available
>
> Yes, and the error code tells you why, right?
>
>

Thanks for pointing that out. I wasn't aware of std::errc (I hope you
mean this). In order to check the error code, we rely on an exception to
be thrown which is not commen c++ practis, imho.

Following your argumentation the "exists" function from the proposal is
superfluous, too.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Thiago Macieira <thiago@macieira.org>
Date: Mon, 16 Jun 2014 13:41:56 -0700
Raw View
Em seg 16 jun 2014, =E0s 22:08:30, Markus Mayer escreveu:
> >> Being unable to open a file, can have multiple reasons:
> >> - File not present
> >> - Access denied
> >> - Device not available
> >> - ...
> >=20
> > On POSIX systems, the actual filesystem operations are done using the
> > hidden "FSUID" of the running program, which is usually the same as the
> > EUID. That means programs might be able to open files that they shouldn=
't
> > open. That's why there's an access(2) call that check whether the real
> > UID of the current process could open the file.
> >=20
> > Are you asking for a function similar to access(2)?
>=20
> I don't mean a function similar to access. Just: Is writing to this file=
=20
> possible?

The best way to verify whether you can write to such a file is to write to =
it.

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Tue, 17 Jun 2014 00:34:30 +0200
Raw View
--001a1134c904d56a4304fbfba34f
Content-Type: text/plain; charset=UTF-8

On 16 June 2014 21:14, Markus Mayer <lotharlutz@gmx.de> wrote:

> Being unable to open a file, can have multiple reasons:
> - File not present
> - Access denied
> - Device not available
>

And those reasons can change between the time you query it and the time you
open it.  You might as well try and open it.
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a1134c904d56a4304fbfba34f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 16 June 2014 21:14, Markus Mayer <span dir=3D"ltr">&lt;=
<a href=3D"mailto:lotharlutz@gmx.de" target=3D"_blank">lotharlutz@gmx.de</a=
>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote=
"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:=
1px #ccc solid;padding-left:1ex">

<div class=3D"">Being unable to open a file, can have multiple reasons:<br>=
</div>
- File not present<br>
- Access denied<br>
- Device not available<br></blockquote><div><br></div><div>And those reason=
s can change between the time you query it and the time you open it. =C2=A0=
You might as well try and open it.</div></div>-- <br>=C2=A0Nevin &quot;:-)&=
quot; Liber=C2=A0 &lt;mailto:<a href=3D"mailto:nevin@eviloverlord.com" targ=
et=3D"_blank">nevin@eviloverlord.com</a>&gt;=C2=A0 (847) 691-1404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a1134c904d56a4304fbfba34f--

.


Author: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Date: Mon, 16 Jun 2014 22:19:08 -0700 (PDT)
Raw View
------=_Part_1345_23554124.1402982348915
Content-Type: text/plain; charset=UTF-8

You may want to show a directory listing with a r/w permissions column
without having to overwrite all the files... Even if you use append mode
when "try opening" the files you may get into trouble if another process
does the same (for same or other reason) simultaneously. It also reduces
system reliability and performance in many cases to write-open files
unnecessarily.

Den tisdagen den 17:e juni 2014 kl. 00:35:12 UTC+2 skrev Nevin ":-)" Liber:
>
> On 16 June 2014 21:14, Markus Mayer <lotha...@gmx.de <javascript:>> wrote:
>
>> Being unable to open a file, can have multiple reasons:
>> - File not present
>> - Access denied
>> - Device not available
>>
>
> And those reasons can change between the time you query it and the time
> you open it.  You might as well try and open it.
> --
>  Nevin ":-)" Liber  <mailto:ne...@eviloverlord.com <javascript:>>  (847)
> 691-1404
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_1345_23554124.1402982348915
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">You may want to show a directory listing with a r/w permis=
sions column without having to overwrite all the files... Even if you use a=
ppend mode when "try opening" the files you may get into trouble if another=
 process does the same (for same or other reason) simultaneously. It also r=
educes system reliability and performance in many cases to write-open files=
 unnecessarily.<br><br>Den tisdagen den 17:e juni 2014 kl. 00:35:12 UTC+2 s=
krev Nevin ":-)" Liber:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div di=
r=3D"ltr">On 16 June 2014 21:14, Markus Mayer <span dir=3D"ltr">&lt;<a href=
=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"XnoiaOy49QQJ" o=
nmousedown=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=
=3D'javascript:';return true;">lotha...@gmx.de</a>&gt;</span> wrote:<br><di=
v><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>Being unable to open a file, can have multiple reasons:<br></div>
- File not present<br>
- Access denied<br>
- Device not available<br></blockquote><div><br></div><div>And those reason=
s can change between the time you query it and the time you open it. &nbsp;=
You might as well try and open it.</div></div>-- <br>&nbsp;Nevin ":-)" Libe=
r&nbsp; &lt;mailto:<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated=
-mailto=3D"XnoiaOy49QQJ" onmousedown=3D"this.href=3D'javascript:';return tr=
ue;" onclick=3D"this.href=3D'javascript:';return true;">ne...@eviloverlord.=
com</a><wbr>&gt;&nbsp; (847) 691-1404
</div></div>
</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1345_23554124.1402982348915--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Tue, 17 Jun 2014 08:12:15 +0200
Raw View
--047d7b5d2deadfdeb804fc0208d2
Content-Type: text/plain; charset=UTF-8

On 17 June 2014 07:19, Bengt Gustafsson <bengt.gustafsson@beamways.com>
wrote:

> You may want to show a directory listing with a r/w permissions column
> without having to overwrite all the files...
>

For the few people on the planet rewriting 'ls', there is still status().


> Even if you use append mode when "try opening" the files you may get into
> trouble if another process does the same (for same or other reason)
> simultaneously.
>

I don't see how adding more unsynchronized operations helps address the
race condition you allude to here.  The world can change between the query
and the open.


>  It also reduces system reliability and performance in many cases to
> write-open files unnecessarily.
>

Presumably I'm opening the files because, well, I need to write to them.
 Either I have to open it myself, or something else in my process has
already opened it and I have to have a way to get to the file handle.
 Either way, I'm not speculatively opening a bunch of files.  I'm just not
seeing the "many cases to write-open files" happening in anything but a
contrived situation.

Even if I were, I still don't see how introducing more race conditions does
anything but hinder system reliability, nor do I see why a bunch of opens,
even if they are just followed by closes, is putting a stress on a system.

Are you trying to do "double checked locking" with the filesystem?

Small code examples with practical problems you've had in this area would
most certainly help the discussion.  Since this also had performance
implications for you, could you share your performance measurements with us?
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--047d7b5d2deadfdeb804fc0208d2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 17 June 2014 07:19, Bengt Gustafsson <span dir=3D"ltr">=
&lt;<a href=3D"mailto:bengt.gustafsson@beamways.com" target=3D"_blank">beng=
t.gustafsson@beamways.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extr=
a"><div class=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">You may want to show a dire=
ctory listing with a r/w permissions column without having to overwrite all=
 the files... </div>

</blockquote><div><br></div><div>For the few people on the planet rewriting=
 &#39;ls&#39;, there is still status().</div><div>=C2=A0</div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex">

<div dir=3D"ltr">Even if you use append mode when &quot;try opening&quot; t=
he files you may get into trouble if another process does the same (for sam=
e or other reason) simultaneously.</div></blockquote><div><br></div><div>

I don&#39;t see how adding more unsynchronized operations helps address the=
 race condition you allude to here. =C2=A0The world can change between the =
query and the open.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir=3D"ltr"> It also reduces system reliability and performance in man=
y cases to write-open files unnecessarily.<br></div></blockquote><div><br><=
/div><div>Presumably I&#39;m opening the files because, well, I need to wri=
te to them. =C2=A0Either I have to open it myself, or something else in my =
process has already opened it and I have to have a way to get to the file h=
andle. =C2=A0Either way, I&#39;m not speculatively opening a bunch of files=
.. =C2=A0I&#39;m just not seeing the &quot;many cases to write-open files&qu=
ot; happening in anything but a contrived situation.</div>

<div><br></div><div>Even if I were, I still don&#39;t see how introducing m=
ore race conditions does anything but hinder system reliability, nor do I s=
ee why a bunch of opens, even if they are just followed by closes, is putti=
ng a stress on a system.</div>

<div><br></div><div>Are you trying to do &quot;double checked locking&quot;=
 with the filesystem?</div><div><br></div><div>Small code examples with pra=
ctical problems you&#39;ve had in this area would most certainly help the d=
iscussion. =C2=A0Since this also had performance implications for you, coul=
d you share your performance measurements with us?</div>

</div>-- <br>=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"=
mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>=
&gt;=C2=A0 (847) 691-1404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7b5d2deadfdeb804fc0208d2--

.


Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Wed, 18 Jun 2014 13:21:29 -0700 (PDT)
Raw View
------=_Part_4895_24392032.1403122890062
Content-Type: text/plain; charset=UTF-8

On Monday, June 16, 2014 11:12:57 PM UTC-7, Nevin ":-)" Liber wrote:
>
> On 17 June 2014 07:19, Bengt Gustafsson <bengt.gu...@beamways.com
> <javascript:>> wrote:
>
>> You may want to show a directory listing with a r/w permissions column
>> without having to overwrite all the files...
>>
>
> For the few people on the planet rewriting 'ls', there is still status().
>

Think of graphical user interfaces. It would be non-ideal to toss in a few
thousand `open for write` calls to thousands of full image files in a photo
management app, for instance (it'll probably want to open the thumbnail
file for reading, sure). If I have a file loaded up in an editor (say, a
text editor or word processor), do I need to open a writeable handle to the
file I just read to show a read-only indicator in the UI? There are plenty
of cases where the state of a file being writable is not critical (it
doesn't need to be 100% correct all the time) but is nice to know and
display anyway; file accesses also don't change all that frequently in the
common case so even if the system technically can get out of date it's not
a problem in practice for most desktop applications.

>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_4895_24392032.1403122890062
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, June 16, 2014 11:12:57 PM UTC-7, Nevin ":-)" Li=
ber wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">On =
17 June 2014 07:19, Bengt Gustafsson <span dir=3D"ltr">&lt;<a href=3D"javas=
cript:" target=3D"_blank" gdf-obfuscated-mailto=3D"blRGIsMx5GYJ" onmousedow=
n=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javasc=
ript:';return true;">bengt.gu...@beamways.com</a><wbr>&gt;</span> wrote:<br=
><div><div class=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">You may want to show a dire=
ctory listing with a r/w permissions column without having to overwrite all=
 the files... </div>

</blockquote><div><br></div><div>For the few people on the planet rewriting=
 'ls', there is still status().</div></div></div></div></blockquote><div><b=
r></div><div>Think of graphical user interfaces. It would be non-ideal to t=
oss in a few thousand `open for write` calls to thousands of full image fil=
es in a photo management app, for instance (it'll probably want to open the=
 thumbnail file for reading, sure). If I have a file loaded up in an editor=
 (say, a text editor or word processor), do I need to open a writeable hand=
le to the file I just read to show a read-only indicator in the UI? There a=
re plenty of cases where the state of a file being writable is not critical=
 (it doesn't need to be 100% correct all the time) but is nice to know and =
display anyway; file accesses also don't change all that frequently in the =
common case so even if the system technically can get out of date it's not =
a problem in practice for most desktop applications.</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;">
</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_4895_24392032.1403122890062--

.


Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Wed, 18 Jun 2014 22:28:45 +0200
Raw View
2014-06-18 22:21 GMT+02:00 Sean Middleditch <sean.middleditch@gmail.com>:
> On Monday, June 16, 2014 11:12:57 PM UTC-7, Nevin ":-)" Liber wrote:
>>
>> On 17 June 2014 07:19, Bengt Gustafsson <bengt.gu...@beamways.com> wrote:
>>>
>>> You may want to show a directory listing with a r/w permissions column
>>> without having to overwrite all the files...
>>
>>
>> For the few people on the planet rewriting 'ls', there is still status().
>
> Think of graphical user interfaces. It would be non-ideal to toss in a few
> thousand `open for write` calls to thousands of full image files in a photo
> management app, for instance (it'll probably want to open the thumbnail file
> for reading, sure). If I have a file loaded up in an editor (say, a text
> editor or word processor), do I need to open a writeable handle to the file
> I just read to show a read-only indicator in the UI? There are plenty of
> cases where the state of a file being writable is not critical (it doesn't
> need to be 100% correct all the time) but is nice to know and display
> anyway; file accesses also don't change all that frequently in the common
> case so even if the system technically can get out of date it's not a
> problem in practice for most desktop applications.

I think I can buy that this is a reasonable feature request and I'm
pretty sure that
a future extension of that kind should be possible.

Please feel invited to write a corresponding proposal to these
effects. (It is presumably not very reasonable to this quite now, but
maybe in half a year or so).

If you have any questions about the criteria of writing such a
proposal, please read

https://isocpp.org/std/submit-a-proposal

and if you still have further questions, send an email to the lwgchair
address available here:

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html

- Daniel

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Olaf van der Spek <olafvdspek@gmail.com>
Date: Wed, 18 Jun 2014 14:46:25 -0700 (PDT)
Raw View
------=_Part_419_3667965.1403127985563
Content-Type: text/plain; charset=UTF-8

On Wednesday, June 18, 2014 10:21:30 PM UTC+2, Sean Middleditch wrote:
>
> On Monday, June 16, 2014 11:12:57 PM UTC-7, Nevin ":-)" Liber wrote:
>>
>> On 17 June 2014 07:19, Bengt Gustafsson <bengt.gu...@beamways.com> wrote:
>>
>>> You may want to show a directory listing with a r/w permissions column
>>> without having to overwrite all the files...
>>>
>>
>> For the few people on the planet rewriting 'ls', there is still status().
>>
>
> Think of graphical user interfaces. It would be non-ideal to toss in a few
> thousand `open for write` calls to thousands of full image files in a photo
> management app, for instance (it'll probably want to open the thumbnail
> file for reading, sure).
>

Why would such an app need to know writability for each image?


> If I have a file loaded up in an editor (say, a text editor or word
> processor), do I need to open a writeable handle to the file I just read to
> show a read-only indicator in the UI?
>

Opening read-write at first and falling back to read-only if that fails
seems reasonable. You need to do something anyway, right?

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_419_3667965.1403127985563
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, June 18, 2014 10:21:30 PM UTC+2, Sean Middle=
ditch wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">O=
n Monday, June 16, 2014 11:12:57 PM UTC-7, Nevin ":-)" Liber wrote:<blockqu=
ote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On 17 June 2014 07:19, Ben=
gt Gustafsson <span dir=3D"ltr">&lt;<a>bengt.gu...@beamways.com</a>&gt;</sp=
an> wrote:<br><div><div class=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">You may want to show a dire=
ctory listing with a r/w permissions column without having to overwrite all=
 the files... </div>

</blockquote><div><br></div><div>For the few people on the planet rewriting=
 'ls', there is still status().</div></div></div></div></blockquote><div><b=
r></div><div>Think of graphical user interfaces. It would be non-ideal to t=
oss in a few thousand `open for write` calls to thousands of full image fil=
es in a photo management app, for instance (it'll probably want to open the=
 thumbnail file for reading, sure). </div></div></blockquote><div><br></div=
><div>Why would such an app need to know writability for each image?</div><=
div>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r"><div>If I have a file loaded up in an editor (say, a text editor or word=
 processor), do I need to open a writeable handle to the file I just read t=
o show a read-only indicator in the UI?&nbsp;</div></div></blockquote><div>=
<br></div><div>Opening read-write at first and falling back to read-only if=
 that fails seems reasonable. You need to do something anyway, right?&nbsp;=
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_419_3667965.1403127985563--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 19 Jun 2014 01:48:43 +0200
Raw View
--089e01493d70f365f504fc24e8b7
Content-Type: text/plain; charset=UTF-8

On 18 June 2014 22:21, Sean Middleditch <sean.middleditch@gmail.com> wrote:

> On Monday, June 16, 2014 11:12:57 PM UTC-7, Nevin ":-)" Liber wrote:
>
>> On 17 June 2014 07:19, Bengt Gustafsson <bengt.gu...@beamways.com> wrote:
>>
>>> You may want to show a directory listing with a r/w permissions column
>>> without having to overwrite all the files...
>>>
>>
>> For the few people on the planet rewriting 'ls', there is still status().
>>
>
> Think of graphical user interfaces. It would be non-ideal to toss in a few
> thousand `open for write` calls to thousands of full image files in a photo
> management app, for instance (it'll probably want to open the thumbnail
> file for reading, sure).
>

I don't get it.  You have open() and status().  What underlying OS
primitive do you use now to do this which is more efficient than open() or
the stat() family and has no mapping to the Filesystem API?  Can you post a
sample of your current implementation w/o the Filesystem API for doing this?
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--089e01493d70f365f504fc24e8b7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 18 June 2014 22:21, Sean Middleditch <span dir=3D"ltr">=
&lt;<a href=3D"mailto:sean.middleditch@gmail.com" target=3D"_blank">sean.mi=
ddleditch@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><di=
v class=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Monday, June 16, 2014 11=
:12:57 PM UTC-7, Nevin &quot;:-)&quot; Liber wrote:<div class=3D""><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1=
px #ccc solid;padding-left:1ex">

<div dir=3D"ltr">On 17 June 2014 07:19, Bengt Gustafsson <span dir=3D"ltr">=
&lt;<a>bengt.gu...@beamways.com</a><u></u>&gt;</span> wrote:<br><div><div c=
lass=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">You may want to show a dire=
ctory listing with a r/w permissions column without having to overwrite all=
 the files... </div>



</blockquote><div><br></div><div>For the few people on the planet rewriting=
 &#39;ls&#39;, there is still status().</div></div></div></div></blockquote=
><div><br></div></div><div>Think of graphical user interfaces. It would be =
non-ideal to toss in a few thousand `open for write` calls to thousands of =
full image files in a photo management app, for instance (it&#39;ll probabl=
y want to open the thumbnail file for reading, sure).</div>

</div></blockquote><div><br></div><div>I don&#39;t get it. =C2=A0You have o=
pen() and status(). =C2=A0What underlying OS primitive do you use now to do=
 this which is more efficient than open() or the stat() family and has no m=
apping to the Filesystem API? =C2=A0Can you post a sample of your current i=
mplementation w/o the Filesystem API for doing this?</div>

</div>-- <br>=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"=
mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>=
&gt;=C2=A0 (847) 691-1404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e01493d70f365f504fc24e8b7--

.


Author: Sean Middleditch <sean@middleditch.us>
Date: Wed, 18 Jun 2014 17:01:48 -0700
Raw View
On Wed, Jun 18, 2014 at 2:46 PM, Olaf van der Spek <olafvdspek@gmail.com> wrote:
> Why would such an app need to know writability for each image?

It might display an icon indicating that it is read-only or
hide/disable buttons by default that modify the image. There are
plenty of examples of applications like this. Many text editors use
this information. Content systems like 3D editors and game editors
often do it. Web-based file services sometimes do it. A file manager
needs it. Office does it. etc.

Clearly more than just `ls` that uses such a basic operation.

> Opening read-write at first and falling back to read-only if that fails
> seems reasonable. You need to do something anyway, right?

"Try an operation you don't actually need to do in order to check a
property" is not, to me, a good definition for "reasonable."

Ultimately it's not a huge deal. Platform APIs aren't going away anytime soon

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 19 Jun 2014 02:45:14 +0200
Raw View
--f46d0435c05212d0be04fc25b3b6
Content-Type: text/plain; charset=UTF-8

On 19 June 2014 02:01, Sean Middleditch <sean@middleditch.us> wrote:

> Clearly more than just `ls` that uses such a basic operation.
>

Again I'll ask you:  what is the missing mapping from low level OS API to
Filesystem API?  Is it cross platform, and if not, how do you implement it
on other platforms?
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--f46d0435c05212d0be04fc25b3b6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 19 June 2014 02:01, Sean Middleditch <span dir=3D"ltr">=
&lt;<a href=3D"mailto:sean@middleditch.us" target=3D"_blank">sean@middledit=
ch.us</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gma=
il_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"">Clearly more than just `ls` =
that uses such a basic operation.<br></div></blockquote><div><br></div><div=
>
Again I&#39;ll ask you: =C2=A0what is the missing mapping from low level OS=
 API to Filesystem API? =C2=A0Is it cross platform, and if not, how do you =
implement it on other platforms?</div>
</div>-- <br>=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"=
mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>=
&gt;=C2=A0 (847) 691-1404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--f46d0435c05212d0be04fc25b3b6--

.


Author: Sean Middleditch <sean@middleditch.us>
Date: Wed, 18 Jun 2014 18:18:05 -0700
Raw View
On Wed, Jun 18, 2014 at 5:45 PM, Nevin Liber <nevin@eviloverlord.com> wrote:
> On 19 June 2014 02:01, Sean Middleditch <sean@middleditch.us> wrote:
>>
>> Clearly more than just `ls` that uses such a basic operation.
>
>
> Again I'll ask you:  what is the missing mapping from low level OS API to
> Filesystem API?  Is it cross platform, and if not, how do you implement it
> on other platforms?

Maybe I'm missing something, but `status()` tells you nothing about
whether a file is read-only that I can tell.

POSIX `stat` tells you this (assuming no ACLs/MAC) and `access` tell
you with more authority; Win32 has `GetFileSecurity` and `AccessCheck`
and friends. Many embedded systems don't even need special syscalls
since there is a clear mapping between paths that are read-only,
transient, and read-write. `stat` is about as cross-platform as you
can get (Win32 has it, at least), though it tells an incomplete
picture even on modern POSIX systems.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
Date: Wed, 18 Jun 2014 23:05:59 -0700 (PDT)
Raw View
------=_Part_5152_3952818.1403157959713
Content-Type: text/plain; charset=UTF-8

On Wednesday, June 18, 2014 6:18:06 PM UTC-7, Sean Middleditch wrote:
>
> On Wed, Jun 18, 2014 at 5:45 PM, Nevin Liber <ne...@eviloverlord.com
> <javascript:>> wrote:
> > On 19 June 2014 02:01, Sean Middleditch <se...@middleditch.us
> <javascript:>> wrote:
> >>
> >> Clearly more than just `ls` that uses such a basic operation.
> >
> >
> > Again I'll ask you:  what is the missing mapping from low level OS API
> to
> > Filesystem API?  Is it cross platform, and if not, how do you implement
> it
> > on other platforms?
>
> Maybe I'm missing something, but `status()` tells you nothing about
> whether a file is read-only that I can tell.
>

What about the permissions() member of file_status?

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_5152_3952818.1403157959713
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, June 18, 2014 6:18:06 PM UTC-7, Sean Middled=
itch wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Wed, Jun 18, 201=
4 at 5:45 PM, Nevin Liber &lt;<a href=3D"javascript:" target=3D"_blank" gdf=
-obfuscated-mailto=3D"oFwCgdYq3MYJ" onmousedown=3D"this.href=3D'javascript:=
';return true;" onclick=3D"this.href=3D'javascript:';return true;">ne...@ev=
iloverlord.com</a>&gt; wrote:
<br>&gt; On 19 June 2014 02:01, Sean Middleditch &lt;<a href=3D"javascript:=
" target=3D"_blank" gdf-obfuscated-mailto=3D"oFwCgdYq3MYJ" onmousedown=3D"t=
his.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:'=
;return true;">se...@middleditch.us</a>&gt; wrote:
<br>&gt;&gt;
<br>&gt;&gt; Clearly more than just `ls` that uses such a basic operation.
<br>&gt;
<br>&gt;
<br>&gt; Again I'll ask you: &nbsp;what is the missing mapping from low lev=
el OS API to
<br>&gt; Filesystem API? &nbsp;Is it cross platform, and if not, how do you=
 implement it
<br>&gt; on other platforms?
<br>
<br>Maybe I'm missing something, but `status()` tells you nothing about
<br>whether a file is read-only that I can tell.
<br></blockquote><div><br>What about the permissions() member of file_statu=
s?<br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5152_3952818.1403157959713--

.


Author: masse.nicolas@gmail.com
Date: Thu, 19 Jun 2014 03:57:38 -0700 (PDT)
Raw View
------=_Part_7_30039169.1403175458932
Content-Type: text/plain; charset=UTF-8

From N3940:

*Windows: All permissions except write are currently ignored. There is only
> a single write permission; setting write permission for owner, group, or
> others sets write permission for all, and removing write permission for
> owner, group, or others removes write permission for all. The Cygwin users
> guide has extensive discussion of the problems involved. Input from
> security experts is needed.*


Basically, it seems that the filesystem API is based on POSIX, and does not
support ACL-based security.
So clearly, such an API will cause problems on windows systems (and
probably some other too, but I'm not an expert here).
At least an "access" method to check wether a file is readable or writable
for example could fix part of the problem.

On Thursday, June 19, 2014 8:06:00 AM UTC+2, Jeremy Maitin-Shepard wrote:
>
> On Wednesday, June 18, 2014 6:18:06 PM UTC-7, Sean Middleditch wrote:
>>
>> On Wed, Jun 18, 2014 at 5:45 PM, Nevin Liber <ne...@eviloverlord.com>
>> wrote:
>> > On 19 June 2014 02:01, Sean Middleditch <se...@middleditch.us> wrote:
>> >>
>> >> Clearly more than just `ls` that uses such a basic operation.
>> >
>> >
>> > Again I'll ask you:  what is the missing mapping from low level OS API
>> to
>> > Filesystem API?  Is it cross platform, and if not, how do you implement
>> it
>> > on other platforms?
>>
>> Maybe I'm missing something, but `status()` tells you nothing about
>> whether a file is read-only that I can tell.
>>
>
> What about the permissions() member of file_status?
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_7_30039169.1403175458932
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">From N3940:<br><br><blockquote style=3D"margin: 0px 0px 0p=
x 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" cla=
ss=3D"gmail_quote"><i><span style=3D"background-color: #E0E0E0">Windows: Al=
l permissions except=20
write are currently ignored. There is only a single write permission; setti=
ng=20
write permission for owner, group, or others sets write permission for all,=
 and=20
removing write permission for owner, group, or others removes write permiss=
ion=20
for all. The Cygwin users guide has extensive discussion of the problems=20
involved. Input from security experts is needed.</span></i></blockquote><br=
>Basically, it seems that the filesystem API is based on POSIX, and does no=
t support ACL-based security.<br>So clearly, such an API will cause problem=
s on windows systems (and probably some other too, but I'm not an expert he=
re). <br>At least an "access" method to check wether a file is readable or =
writable for example could fix part of the problem.<br><br>On Thursday, Jun=
e 19, 2014 8:06:00 AM UTC+2, Jeremy Maitin-Shepard wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr">On Wednesday, June 18, 2014 6:=
18:06 PM UTC-7, Sean Middleditch wrote:<blockquote class=3D"gmail_quote" st=
yle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1=
ex">On Wed, Jun 18, 2014 at 5:45 PM, Nevin Liber &lt;<a>ne...@eviloverlord.=
com</a>&gt; wrote:
<br>&gt; On 19 June 2014 02:01, Sean Middleditch &lt;<a>se...@middleditch.u=
s</a>&gt; wrote:
<br>&gt;&gt;
<br>&gt;&gt; Clearly more than just `ls` that uses such a basic operation.
<br>&gt;
<br>&gt;
<br>&gt; Again I'll ask you: &nbsp;what is the missing mapping from low lev=
el OS API to
<br>&gt; Filesystem API? &nbsp;Is it cross platform, and if not, how do you=
 implement it
<br>&gt; on other platforms?
<br>
<br>Maybe I'm missing something, but `status()` tells you nothing about
<br>whether a file is read-only that I can tell.
<br></blockquote><div><br>What about the permissions() member of file_statu=
s?<br></div></div></blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_7_30039169.1403175458932--

.


Author: Markus Mayer <lotharlutz@gmx.de>
Date: Sat, 21 Jun 2014 11:25:21 +0200
Raw View
On 06/19/2014 08:05 AM, Jeremy Maitin-Shepard wrote:
> On Wednesday, June 18, 2014 6:18:06 PM UTC-7, Sean Middleditch wrote:
>
>     On Wed, Jun 18, 2014 at 5:45 PM, Nevin Liber <ne...@eviloverlord.com
>     <javascript:>> wrote:
>      > On 19 June 2014 02:01, Sean Middleditch <se...@middleditch.us
>     <javascript:>> wrote:
>      >>
>      >> Clearly more than just `ls` that uses such a basic operation.
>      >
>      >
>      > Again I'll ask you:  what is the missing mapping from low level
>     OS API to
>      > Filesystem API?  Is it cross platform, and if not, how do you
>     implement it
>      > on other platforms?
>
>     Maybe I'm missing something, but `status()` tells you nothing about
>     whether a file is read-only that I can tell.
>
>
> What about the permissions() member of file_status?
>

imho, permissions() is quite useless. It only tells you what permissions
the owner/groups/other have. But not who is the owner(...). It is like
saying: "There is someone who has the keys to your car, but I don't know
who it is."

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: David Krauss <potswa@gmail.com>
Date: Sat, 21 Jun 2014 17:43:29 +0800
Raw View
--Apple-Mail=_CBDC72A2-6F00-4278-9586-79491991DB66
Content-Type: text/plain; charset=ISO-8859-1


On 2014-06-21, at 5:25 PM, Markus Mayer <lotharlutz@gmx.de> wrote:

> imho, permissions() is quite useless. It only tells you what permissions the owner/groups/other have. But not who is the owner(...). It is like saying: "There is someone who has the keys to your car, but I don't know who it is."

Are permissions (and user identity) really part of a filesystem any more than string processing is, since filenames are strings?

Perhaps these capabilities should be part of a security and authentication library, even a ridiculously rudimentary one. A stub library just to give class user a home is better than filesystem feature creep.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--Apple-Mail=_CBDC72A2-6F00-4278-9586-79491991DB66
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-=
mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 2014&=
ndash;06&ndash;21, at 5:25 PM, Markus Mayer &lt;<a href=3D"mailto:lotharlut=
z@gmx.de">lotharlutz@gmx.de</a>&gt; wrote:</div><br class=3D"Apple-intercha=
nge-newline"><blockquote type=3D"cite"><div style=3D"font-size: 12px; font-=
style: normal; font-variant: normal; font-weight: normal; letter-spacing: n=
ormal; line-height: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; word-spacing:=
 0px; -webkit-text-stroke-width: 0px;">imho, permissions() is quite useless=
.. It only tells you what permissions the owner/groups/other have. But not w=
ho is the owner(...). It is like saying: "There is someone who has the keys=
 to your car, but I don't know who it is.&rdquo;</div></blockquote><br></di=
v><div>Are permissions (and user identity) really part of a filesystem any =
more than string processing is, since filenames are strings?</div><br><div>=
Perhaps these capabilities should be part of a security and authentication =
library, even a ridiculously rudimentary one. A stub library just to give <=
font face=3D"Courier">class user</font> a home is better than filesystem fe=
ature creep.</div><div><br></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_CBDC72A2-6F00-4278-9586-79491991DB66--

.


Author: Markus Mayer <lotharlutz@gmx.de>
Date: Sat, 21 Jun 2014 13:27:11 +0200
Raw View
On 06/21/2014 11:43 AM, David Krauss wrote:
>
> On 2014-06-21, at 5:25 PM, Markus Mayer <lotharlutz@gmx.de
> <mailto:lotharlutz@gmx.de>> wrote:
>
>> imho, permissions() is quite useless. It only tells you what
>> permissions the owner/groups/other have. But not who is the
>> owner(...). It is like saying: "There is someone who has the keys to
>> your car, but I don't know who it is."
>
> Are permissions (and user identity) really part of a filesystem any more
> than string processing is, since filenames are strings?
>
> Perhaps these capabilities should be part of a security and
> authentication library, even a ridiculously rudimentary one. A stub
> library just to give class user a home is better than filesystem feature
> creep.

I'm in favor of putting 'permissions()' out of the filesystem proposal.
If there is a need of permission handling it should be handled in a
separate proposal. Given that the permission system various a lot
between platforms, more investigation is needed.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Thiago Macieira <thiago@macieira.org>
Date: Sat, 21 Jun 2014 09:21:34 -0700
Raw View
Em s=E1b 21 jun 2014, =E0s 11:25:21, Markus Mayer escreveu:
> imho, permissions() is quite useless. It only tells you what permissions=
=20
> the owner/groups/other have. But not who is the owner(...). It is like=20
> saying: "There is someone who has the keys to your car, but I don't know=
=20
> who it is."

If you look at QFile::permissions() [1], you're going to find it really str=
ange=20
if you're coming from POSIX, It doesn't keep the permissions in octal like=
=20
POSIX does, but in hex (0x0010 for group write, instead of 0010).

The other notable difference is that it has the permissions for the current=
=20
user, in addition to the file's owner. It does exactly what Markus is askin=
g=20
for.

Anyway, be extremely careful of Time-of-Check Time-of-Use (TOCTOU) attacks.=
=20
It's best to write an application that doesn't check that it can do somethi=
ng=20
until it actually needs to do that something.

[1] http://qt-project.org/doc/qt-5/qfile.html#permissions
--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: Matthew Woehlke <mw_triad@users.sourceforge.net>
Date: Fri, 19 Sep 2014 18:08:42 -0400
Raw View
On 2014-06-21 07:27, Markus Mayer wrote:
> On 06/21/2014 11:43 AM, David Krauss wrote:
>>
>> On 2014-06-21, at 5:25 PM, Markus Mayer <lotharlutz@gmx.de
>> <mailto:lotharlutz@gmx.de>> wrote:
>>
>>> imho, permissions() is quite useless. It only tells you what
>>> permissions the owner/groups/other have. But not who is the
>>> owner(...). It is like saying: "There is someone who has the keys to
>>> your car, but I don't know who it is."
>>
>> Are permissions (and user identity) really part of a filesystem any more
>> than string processing is, since filenames are strings?
>>
>> Perhaps these capabilities should be part of a security and
>> authentication library, even a ridiculously rudimentary one. A stub
>> library just to give class user a home is better than filesystem feature
>> creep.
>
> I'm in favor of putting 'permissions()' out of the filesystem proposal.
> If there is a need of permission handling it should be handled in a
> separate proposal. Given that the permission system various a lot
> between platforms, more investigation is needed.

I imagine it's a bit late :-), but FWIW I'd be inclined to agree... full
access permissions are a hairy beast and likely only of interest to file
management problems.

What might be useful at this level would be more like bash permission
checks... rather than try to explain the full permissions, just have
simple tests for the permissions available to the caller:

  - file is readable by you?
  - file is writable by you? (*DOES NOT* imply that file is readable!)
  - file is executable by you?
  - file is effectively owned by you?
  - file is effectively owned by your group?

--
Matthew

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.