Topic: File globbing in the standard library


Author: Morwenn <morwenn29@gmail.com>
Date: Wed, 8 Jun 2016 01:53:03 -0700 (PDT)
Raw View
------=_Part_4168_1644600935.1465375983617
Content-Type: multipart/alternative;
 boundary="----=_Part_4169_1795836977.1465375983626"

------=_Part_4169_1795836977.1465375983626
Content-Type: text/plain; charset=UTF-8

The C++17 standard filesystem library would benefit from a generic file
globbing utility, which is a really common operation when dealing with
files.
Here is a brief description of how I would envision it:

   - Add a glob dialect to the regular expression libraries (with standard
   jokers, including **).
   - Add a glob function to path (or somewhere else) taking an std::regex.
   - Add overloads to glob for std::string, std::string_view, const char*
   that default to the newly introduced glob dialect.

I guess that the string types mentioned above would use
std::filesystem::path::value_type for their value type.

I believe that using std::regex allows to have a truly generic globbing
interface, while defaulting to a regular glob dialect provides the
behaviour people expect by default for a glob function.

Any thoughts about such a design?

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%40isocpp.org.

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

<div dir=3D"ltr">The C++17 standard filesystem library would benefit from a=
 generic file globbing utility, which is a really common operation when dea=
ling with files.<br>Here is a brief description of how I would envision it:=
<br><ul><li>Add a glob dialect to the regular expression libraries (with st=
andard jokers, including <span style=3D"font-family: courier new,monospace;=
">**</span>).</li><li>Add a glob function to path (or somewhere else) takin=
g an <span style=3D"font-family: courier new,monospace;">std::regex</span>.=
</li><li>Add overloads to glob for <span style=3D"font-family: courier new,=
monospace;">std::string</span>, <span style=3D"font-family: courier new,mon=
ospace;">std::string_view</span>, <span style=3D"font-family: courier new,m=
onospace;">const char*</span> that default to the newly introduced glob dia=
lect.</li></ul>I guess that the string types mentioned above would use <spa=
n style=3D"font-family: courier new,monospace;">std::filesystem::path::</sp=
an><code><span style=3D"font-family: arial,sans-serif;"><span style=3D"font=
-family: courier new,monospace;">value_type</span> for their value type.</s=
pan><br><br><span style=3D"font-family: arial,sans-serif;">I believe that u=
sing std::regex allows to have a truly generic globbing interface, while de=
faulting to a regular glob dialect provides the behaviour people expect by =
default for a glob function.</span><br><br><span style=3D"font-family: aria=
l,sans-serif;">Any thoughts about such a design?</span><br></code></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28=
%40isocpp.org</a>.<br />

------=_Part_4169_1795836977.1465375983626--

------=_Part_4168_1644600935.1465375983617--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Wed, 08 Jun 2016 08:47:15 -0400
Raw View
<html><head></head><body lang=3D"en-US" style=3D"background-color: rgb(255,=
 255, 255); line-height: initial;">                                        =
                                              <div style=3D"width: 100%; fo=
nt-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif=
; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, =
255, 255);">Do you want cross-platform behaviour or platform-native behavio=
ur?</div><div style=3D"width: 100%; font-size: initial; font-family: Calibr=
i, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align=
: initial; background-color: rgb(255, 255, 255);"><br></div><div style=3D"w=
idth: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-ser=
if, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-co=
lor: rgb(255, 255, 255);">"*.*" is not the same under dos/windows vs unix/m=
ac/linux.&nbsp;</div><div style=3D"width: 100%; font-size: initial; font-fa=
mily: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125)=
; text-align: initial; background-color: rgb(255, 255, 255);"><br></div><di=
v style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pr=
o', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; b=
ackground-color: rgb(255, 255, 255);">=E2=80=8ECross platform seems nice, b=
ut if a user tpes "*.*" into a custom Open File dialog, I might want (as th=
e user probably expects) per-platform behaviour.&nbsp;</div><div style=3D"w=
idth: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-ser=
if, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-co=
lor: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-size: i=
nitial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: r=
gb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);=
"><br></div>                                                               =
                                                                      <div =
style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro'=
, sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; bac=
kground-color: rgb(255, 255, 255);"><br style=3D"display:initial"></div>   =
                                                                           =
                                                                           =
                                          <div style=3D"font-size: initial;=
 font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, =
73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Sent&=
nbsp;from&nbsp;my&nbsp;BlackBerry&nbsp;portable&nbsp;Babbage&nbsp;Device</d=
iv>                                                                        =
                                                                           =
                               <table width=3D"100%" style=3D"background-co=
lor:white;border-spacing:0px;"> <tbody><tr><td colspan=3D"2" style=3D"font-=
size: initial; text-align: initial; background-color: rgb(255, 255, 255);">=
                           <div style=3D"border-style: solid none none; bor=
der-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in =
0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;"> =
 <div><b>From: </b>Morwenn</div><div><b>Sent: </b>Wednesday, June 8, 2016 4=
:53 AM</div><div><b>To: </b>ISO C++ Standard - Future Proposals</div><div><=
b>Reply To: </b>std-proposals@isocpp.org</div><div><b>Subject: </b>[std-pro=
posals] File globbing in the standard library</div></div></td></tr></tbody>=
</table><div style=3D"border-style: solid none none; border-top-color: rgb(=
186, 188, 209); border-top-width: 1pt; font-size: initial; text-align: init=
ial; background-color: rgb(255, 255, 255);"></div><br><div id=3D"_originalC=
ontent" style=3D""><div dir=3D"ltr">The C++17 standard filesystem library w=
ould benefit from a generic file globbing utility, which is a really common=
 operation when dealing with files.<br>Here is a brief description of how I=
 would envision it:<br><ul><li>Add a glob dialect to the regular expression=
 libraries (with standard jokers, including <span style=3D"font-family: cou=
rier new,monospace;">**</span>).</li><li>Add a glob function to path (or so=
mewhere else) taking an <span style=3D"font-family: courier new,monospace;"=
>std::regex</span>.</li><li>Add overloads to glob for <span style=3D"font-f=
amily: courier new,monospace;">std::string</span>, <span style=3D"font-fami=
ly: courier new,monospace;">std::string_view</span>, <span style=3D"font-fa=
mily: courier new,monospace;">const char*</span> that default to the newly =
introduced glob dialect.</li></ul>I guess that the string types mentioned a=
bove would use <span style=3D"font-family: courier new,monospace;">std::fil=
esystem::path::</span><code><span style=3D"font-family: arial,sans-serif;">=
<span style=3D"font-family: courier new,monospace;">value_type</span> for t=
heir value type.</span><br><br><span style=3D"font-family: arial,sans-serif=
;">I believe that using std::regex allows to have a truly generic globbing =
interface, while defaulting to a regular glob dialect provides the behaviou=
r people expect by default for a glob function.</span><br><br><span style=
=3D"font-family: arial,sans-serif;">Any thoughts about such a design?</span=
><br></code></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.goo=
gle.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195=
fa28%40isocpp.org</a>.<br>
<br><!--end of _originalContent --></div></body></html>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/20160608124715.4915278.35801.11796%40=
gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/20160608124715.4915278.35801.11796%40gm=
ail.com</a>.<br />

.


Author: Morwenn <morwenn29@gmail.com>
Date: Wed, 8 Jun 2016 05:57:18 -0700 (PDT)
Raw View
------=_Part_69_1106703483.1465390638521
Content-Type: multipart/alternative;
 boundary="----=_Part_70_820601104.1465390638521"

------=_Part_70_820601104.1465390638521
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

To be honest, I don't know. I don't think that a platform-native behaviour=
=20
without a choice would be a good idea, but whether it is platform-native or=
=20
not could be a parameter somewhere.

I had Python's glob in mine, which seems to work fine and is=20
platform-agnostic if I'm not mistaken.

Le mercredi 8 juin 2016 14:47:19 UTC+2, Tony V E a =C3=A9crit :
>
> Do you want cross-platform behaviour or platform-native behaviour?
>
> "*.*" is not the same under dos/windows vs unix/mac/linux.=20
>
> =E2=80=8ECross platform seems nice, but if a user tpes "*.*" into a custo=
m Open=20
> File dialog, I might want (as the user probably expects) per-platform=20
> behaviour.=20
>
>
>
> Sent from my BlackBerry portable Babbage Device
> *From: *Morwenn
> *Sent: *Wednesday, June 8, 2016 4:53 AM
> *To: *ISO C++ Standard - Future Proposals
> *Reply To: *std-pr...@isocpp.org <javascript:>
> *Subject: *[std-proposals] File globbing in the standard library
>
> The C++17 standard filesystem library would benefit from a generic file=
=20
> globbing utility, which is a really common operation when dealing with=20
> files.
> Here is a brief description of how I would envision it:
>
>    - Add a glob dialect to the regular expression libraries (with=20
>    standard jokers, including **).
>    - Add a glob function to path (or somewhere else) taking an std::regex=
..
>    - Add overloads to glob for std::string, std::string_view, const char*=
=20
>    that default to the newly introduced glob dialect.
>
> I guess that the string types mentioned above would use=20
> std::filesystem::path::value_type for their value type.
>
> I believe that using std::regex allows to have a truly generic globbing=
=20
> interface, while defaulting to a regular glob dialect provides the=20
> behaviour people expect by default for a glob function.
>
> Any thoughts about such a design?
>
> --=20
> You received this message because you are subscribed to the Google Groups=
=20
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
> email to std-proposal...@isocpp.org <javascript:>.
> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
> To view this discussion on the web visit=20
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f=
7-46d1-b1e0-e5493195fa28%40isocpp.org=20
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2=
f7-46d1-b1e0-e5493195fa28%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
>

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/e1038373-31a1-4417-937c-4d8e3a27527f%40isocpp.or=
g.

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

<div dir=3D"ltr">To be honest, I don&#39;t know. I don&#39;t think that a p=
latform-native behaviour without a choice would be a good idea, but whether=
 it is platform-native or not could be a parameter somewhere.<br><br>I had =
Python&#39;s <span style=3D"font-family: courier new,monospace;">glob</span=
> in mine, which seems to work fine and is platform-agnostic if I&#39;m not=
 mistaken.<br><br>Le mercredi 8 juin 2016 14:47:19 UTC+2, Tony V E a =C3=A9=
crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"backg=
round-color:rgb(255,255,255);line-height:initial" lang=3D"en-US">          =
                                                                           =
 <div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate =
Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;back=
ground-color:rgb(255,255,255)">Do you want cross-platform behaviour or plat=
form-native behaviour?</div><div style=3D"width:100%;font-size:initial;font=
-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,1=
25);text-align:initial;background-color:rgb(255,255,255)"><br></div><div st=
yle=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;=
,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-c=
olor:rgb(255,255,255)">&quot;*.*&quot; is not the same under dos/windows vs=
 unix/mac/linux.=C2=A0</div><div style=3D"width:100%;font-size:initial;font=
-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,1=
25);text-align:initial;background-color:rgb(255,255,255)"><br></div><div st=
yle=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;=
,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-c=
olor:rgb(255,255,255)">=E2=80=8ECross platform seems nice, but if a user tp=
es &quot;*.*&quot; into a custom Open File dialog, I might want (as the use=
r probably expects) per-platform behaviour.=C2=A0</div><div style=3D"width:=
100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,s=
ans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,=
255,255)"><br></div><div style=3D"width:100%;font-size:initial;font-family:=
Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text=
-align:initial;background-color:rgb(255,255,255)"><br></div>               =
                                                                           =
                                           <div style=3D"width:100%;font-si=
ze:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;co=
lor:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)"><b=
r style=3D"display:initial"></div>                                         =
                                                                           =
                                                                           =
    <div style=3D"font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;=
,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-c=
olor:rgb(255,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0<wbr>por=
table=C2=A0Babbage=C2=A0Device</div>                                       =
                                                                           =
                                                                <table styl=
e=3D"background-color:white;border-spacing:0px" width=3D"100%"> <tbody><tr>=
<td colspan=3D"2" style=3D"font-size:initial;text-align:initial;background-=
color:rgb(255,255,255)">                           <div style=3D"border-sty=
le:solid none none;border-top-color:rgb(181,196,223);border-top-width:1pt;p=
adding:3pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#39;Slate Pr=
o&#39;;font-size:10pt">  <div><b>From: </b>Morwenn</div><div><b>Sent: </b>W=
ednesday, June 8, 2016 4:53 AM</div><div><b>To: </b>ISO C++ Standard - Futu=
re Proposals</div><div><b>Reply To: </b><a href=3D"javascript:" target=3D"_=
blank" gdf-obfuscated-mailto=3D"lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=
=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D=
&#39;javascript:&#39;;return true;">std-pr...@isocpp.org</a></div><div><b>S=
ubject: </b>[std-proposals] File globbing in the standard library</div></di=
v></td></tr></tbody></table><div style=3D"border-style:solid none none;bord=
er-top-color:rgb(186,188,209);border-top-width:1pt;font-size:initial;text-a=
lign:initial;background-color:rgb(255,255,255)"></div><br><div><div dir=3D"=
ltr">The C++17 standard filesystem library would benefit from a generic fil=
e globbing utility, which is a really common operation when dealing with fi=
les.<br>Here is a brief description of how I would envision it:<br><ul><li>=
Add a glob dialect to the regular expression libraries (with standard joker=
s, including <span style=3D"font-family:courier new,monospace">**</span>).<=
/li><li>Add a glob function to path (or somewhere else) taking an <span sty=
le=3D"font-family:courier new,monospace">std::regex</span>.</li><li>Add ove=
rloads to glob for <span style=3D"font-family:courier new,monospace">std::s=
tring</span>, <span style=3D"font-family:courier new,monospace">std::string=
_view</span>, <span style=3D"font-family:courier new,monospace">const char*=
</span> that default to the newly introduced glob dialect.</li></ul>I guess=
 that the string types mentioned above would use <span style=3D"font-family=
:courier new,monospace">std::filesystem::path::</span><code><span style=3D"=
font-family:arial,sans-serif"><span style=3D"font-family:courier new,monosp=
ace">value_<wbr>type</span> for their value type.</span><br><br><span style=
=3D"font-family:arial,sans-serif">I believe that using std::regex allows to=
 have a truly generic globbing interface, while defaulting to a regular glo=
b dialect provides the behaviour people expect by default for a glob functi=
on.</span><br><br><span style=3D"font-family:arial,sans-serif">Any thoughts=
 about such a design?</span><br></code></div>

<p></p>

-- <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"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/860ea5e8-d2f7-46d1-<wbr>b1e0-=
e5493195fa28%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/e1038373-31a1-4417-937c-4d8e3a27527f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e1038373-31a1-4417-937c-4d8e3a27527f=
%40isocpp.org</a>.<br />

------=_Part_70_820601104.1465390638521--

------=_Part_69_1106703483.1465390638521--

.


Author: Jim Porter <jvp4846@g.rit.edu>
Date: Thu, 9 Jun 2016 00:42:58 -0500
Raw View
On 6/8/2016 7:57 AM, Morwenn wrote:
> To be honest, I don't know. I don't think that a platform-native
> behaviour without a choice would be a good idea, but whether it is
> platform-native or not could be a parameter somewhere.
>
> I had Python's glob in mine, which seems to work fine and is
> platform-agnostic if I'm not mistaken.

 From Python's documentation[1]:

> The glob module finds all the pathnames matching a specified pattern
> according to the rules used by the Unix shell"

Personally, this seems like something with enough behavioral variance
that I'd expect this to go in Boost or something similar.

- Jim

[1] https://docs.python.org/2/library/glob.html

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/njavlh%243bj%241%40ger.gmane.org.

.


Author: Beman Dawes <bdawes@acm.org>
Date: Fri, 10 Jun 2016 21:27:48 -0400
Raw View
--94eb2c128f400d06100534f692db
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, Jun 8, 2016 at 8:47 AM, Tony V E <tvaneerd@gmail.com> wrote:

> Do you want cross-platform behaviour or platform-native behaviour?
>
> "*.*" is not the same under dos/windows vs unix/mac/linux.
>
> =E2=80=8ECross platform seems nice, but if a user tpes "*.*" into a custo=
m Open
> File dialog, I might want (as the user probably expects) per-platform
> behaviour.
>

Seems to me the context for wanting globbing is directory iteration, so the
first step would be to add an additional constructor to directory_iterator
and recursive_directory_iterator that takes a predicate function object.
The function object would passed each candidate path and would returns a
bool indicating if the path is to be accepted or skipped.

The library could provide both a portable (i.e. POSIX) globbing function
and a native globbing function, or the user could write their own.

I started to prototype that approach a few years ago, but got side tracked
and never got back to it. It is a bit tricky for
recursive_directory_iteration because of the need to keep track of where
the file system recursion is in relation to the globbing elements.

It would be great if someone stepped forward with a formal proposal with
supporting implementation.

--Beman

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAAygHNP3qLdqC%3DS9ccLA_KAxhYTkCzx8k-8NoXXL5B4L5=
tGZPQ%40mail.gmail.com.

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

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Jun 8, 2016 at 8:47 AM, Tony V E <span dir=3D"ltr">&lt;<a href=
=3D"mailto:tvaneerd@gmail.com" target=3D"_blank">tvaneerd@gmail.com</a>&gt;=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div style=3D"background-c=
olor:rgb(255,255,255);line-height:initial" lang=3D"en-US">                 =
                                                                     <div s=
tyle=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39=
;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-=
color:rgb(255,255,255)">Do you want cross-platform behaviour or platform-na=
tive behaviour?</div><div style=3D"width:100%;font-size:initial;font-family=
:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);tex=
t-align:initial;background-color:rgb(255,255,255)"><br></div><div style=3D"=
width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-s=
erif,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rg=
b(255,255,255)">&quot;*.*&quot; is not the same under dos/windows vs unix/m=
ac/linux.=C2=A0</div><div style=3D"width:100%;font-size:initial;font-family=
:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);tex=
t-align:initial;background-color:rgb(255,255,255)"><br></div><div>=E2=80=8E=
Cross platform seems nice, but if a user tpes &quot;*.*&quot; into a custom=
 Open File dialog, I might want (as the user probably expects) per-platform=
 behaviour.</div></div></blockquote><div><br></div><div>Seems to me the con=
text for wanting globbing is directory iteration, so the first step would b=
e to add an additional constructor to directory_iterator and recursive_dire=
ctory_iterator that takes a predicate function object. The function object =
would passed each candidate path and would returns a bool indicating if the=
 path is to be accepted or skipped.<br><br></div><div>The library could pro=
vide both a portable (i.e. POSIX) globbing function and a native globbing f=
unction, or the user could write their own.<br><br></div><div>I started to =
prototype that approach a few years ago, but got side tracked and never got=
 back to it. It is a bit tricky for recursive_directory_iteration because o=
f the need to keep track of where the file system recursion is in relation =
to the globbing elements.<br><br></div><div>It would be great if someone st=
epped forward with a formal proposal with supporting implementation.<br><br=
></div><div>--Beman <br></div></div></div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAAygHNP3qLdqC%3DS9ccLA_KAxhYTkCzx8k-=
8NoXXL5B4L5tGZPQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAAygHNP3qLdqC%=
3DS9ccLA_KAxhYTkCzx8k-8NoXXL5B4L5tGZPQ%40mail.gmail.com</a>.<br />

--94eb2c128f400d06100534f692db--

.


Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Mon, 20 Jun 2016 14:46:28 -0700 (PDT)
Raw View
------=_Part_879_2024987464.1466459188405
Content-Type: multipart/alternative;
 boundary="----=_Part_880_475283141.1466459188406"

------=_Part_880_475283141.1466459188406
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Could/should this be resolved the same way we handle regex, e.g.=20
glob_constants::POSIX, glob_constants::DOS, glob_constants::NATIVE, etc.?

On Wednesday, June 8, 2016 at 5:47:19 AM UTC-7, Tony V E wrote:
>
> Do you want cross-platform behaviour or platform-native behaviour?
>
> "*.*" is not the same under dos/windows vs unix/mac/linux.=20
>
> =E2=80=8ECross platform seems nice, but if a user tpes "*.*" into a custo=
m Open=20
> File dialog, I might want (as the user probably expects) per-platform=20
> behaviour.=20
>
>
>
> Sent from my BlackBerry portable Babbage Device
> *From: *Morwenn
> *Sent: *Wednesday, June 8, 2016 4:53 AM
> *To: *ISO C++ Standard - Future Proposals
> *Reply To: *std-pr...@isocpp.org <javascript:>
> *Subject: *[std-proposals] File globbing in the standard library
>
> The C++17 standard filesystem library would benefit from a generic file=
=20
> globbing utility, which is a really common operation when dealing with=20
> files.
> Here is a brief description of how I would envision it:
>
>    - Add a glob dialect to the regular expression libraries (with=20
>    standard jokers, including **).
>    - Add a glob function to path (or somewhere else) taking an std::regex=
..
>    - Add overloads to glob for std::string, std::string_view, const char*=
=20
>    that default to the newly introduced glob dialect.
>
> I guess that the string types mentioned above would use=20
> std::filesystem::path::value_type for their value type.
>
> I believe that using std::regex allows to have a truly generic globbing=
=20
> interface, while defaulting to a regular glob dialect provides the=20
> behaviour people expect by default for a glob function.
>
> Any thoughts about such a design?
>
> --=20
> You received this message because you are subscribed to the Google Groups=
=20
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
> email to std-proposal...@isocpp.org <javascript:>.
> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
> To view this discussion on the web visit=20
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f=
7-46d1-b1e0-e5493195fa28%40isocpp.org=20
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2=
f7-46d1-b1e0-e5493195fa28%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
>

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/5ae721e4-434b-4ee0-a5fc-415441e6616d%40isocpp.or=
g.

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

<div dir=3D"ltr">Could/should this be resolved the same way we handle regex=
, e.g. glob_constants::POSIX, glob_constants::DOS, glob_constants::NATIVE, =
etc.?<br><br>On Wednesday, June 8, 2016 at 5:47:19 AM UTC-7, Tony V E wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bo=
rder-left: 1px #ccc solid;padding-left: 1ex;"><div lang=3D"en-US" style=3D"=
background-color:rgb(255,255,255);line-height:initial">                    =
                                                                  <div styl=
e=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,s=
ans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-col=
or:rgb(255,255,255)">Do you want cross-platform behaviour or platform-nativ=
e behaviour?</div><div style=3D"width:100%;font-size:initial;font-family:Ca=
libri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-a=
lign:initial;background-color:rgb(255,255,255)"><br></div><div style=3D"wid=
th:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">&quot;*.*&quot; is not the same under dos/windows vs unix/mac/=
linux.=C2=A0</div><div style=3D"width:100%;font-size:initial;font-family:Ca=
libri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-a=
lign:initial;background-color:rgb(255,255,255)"><br></div><div style=3D"wid=
th:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">=E2=80=8ECross platform seems nice, but if a user tpes &quot;*=
..*&quot; into a custom Open File dialog, I might want (as the user probably=
 expects) per-platform behaviour.=C2=A0</div><div style=3D"width:100%;font-=
size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;=
color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">=
<br></div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#=
39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:ini=
tial;background-color:rgb(255,255,255)"><br></div>                         =
                                                                           =
                                 <div style=3D"width:100%;font-size:initial=
;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31=
,73,125);text-align:initial;background-color:rgb(255,255,255)"><br style=3D=
"display:initial"></div>                                                   =
                                                                           =
                                                                     <div s=
tyle=3D"font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0<wbr>portable=C2=
=A0Babbage=C2=A0Device</div>                                               =
                                                                           =
                                                        <table width=3D"100=
%" style=3D"background-color:white;border-spacing:0px"> <tbody><tr><td cols=
pan=3D"2" style=3D"font-size:initial;text-align:initial;background-color:rg=
b(255,255,255)">                           <div style=3D"border-style:solid=
 none none;border-top-color:rgb(181,196,223);border-top-width:1pt;padding:3=
pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#39;Slate Pro&#39;;f=
ont-size:10pt">  <div><b>From: </b>Morwenn</div><div><b>Sent: </b>Wednesday=
, June 8, 2016 4:53 AM</div><div><b>To: </b>ISO C++ Standard - Future Propo=
sals</div><div><b>Reply To: </b><a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"this.=
href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;java=
script:&#39;;return true;">std-pr...@isocpp.org</a></div><div><b>Subject: <=
/b>[std-proposals] File globbing in the standard library</div></div></td></=
tr></tbody></table><div style=3D"border-style:solid none none;border-top-co=
lor:rgb(186,188,209);border-top-width:1pt;font-size:initial;text-align:init=
ial;background-color:rgb(255,255,255)"></div><br><div><div dir=3D"ltr">The =
C++17 standard filesystem library would benefit from a generic file globbin=
g utility, which is a really common operation when dealing with files.<br>H=
ere is a brief description of how I would envision it:<br><ul><li>Add a glo=
b dialect to the regular expression libraries (with standard jokers, includ=
ing <span style=3D"font-family:courier new,monospace">**</span>).</li><li>A=
dd a glob function to path (or somewhere else) taking an <span style=3D"fon=
t-family:courier new,monospace">std::regex</span>.</li><li>Add overloads to=
 glob for <span style=3D"font-family:courier new,monospace">std::string</sp=
an>, <span style=3D"font-family:courier new,monospace">std::string_view</sp=
an>, <span style=3D"font-family:courier new,monospace">const char*</span> t=
hat default to the newly introduced glob dialect.</li></ul>I guess that the=
 string types mentioned above would use <span style=3D"font-family:courier =
new,monospace">std::filesystem::path::</span><code><span style=3D"font-fami=
ly:arial,sans-serif"><span style=3D"font-family:courier new,monospace">valu=
e_<wbr>type</span> for their value type.</span><br><br><span style=3D"font-=
family:arial,sans-serif">I believe that using std::regex allows to have a t=
ruly generic globbing interface, while defaulting to a regular glob dialect=
 provides the behaviour people expect by default for a glob function.</span=
><br><br><span style=3D"font-family:arial,sans-serif">Any thoughts about su=
ch a design?</span><br></code></div>

<p></p>

-- <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"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/860ea5e8-d2f7-46d1-<wbr>b1e0-=
e5493195fa28%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ae721e4-434b-4ee0-a5fc-415441e6616d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5ae721e4-434b-4ee0-a5fc-415441e6616d=
%40isocpp.org</a>.<br />

------=_Part_880_475283141.1466459188406--

------=_Part_879_2024987464.1466459188405--

.


Author: Moritz Klammler <moritz.klammler@gmail.com>
Date: Tue, 21 Jun 2016 00:17:40 +0200
Raw View
Sean Middleditch <sean.middleditch@gmail.com> writes:

> Could/should this be resolved the same way we handle regex, e.g.=20
> glob_constants::POSIX, glob_constants::DOS, glob_constants::NATIVE, etc.?

I think that this is a good way to handle this.  It allows the
application -- and therefore eventually the user -- to decide what their
idea of "portable behavior" is.  It is also open to potential future
extensions such as a hypothetical ISO globing standard.



> On Wednesday, June 8, 2016 at 5:47:19 AM UTC-7, Tony V E wrote:
>>
>> Do you want cross-platform behaviour or platform-native behaviour?
>>
>> "*.*" is not the same under dos/windows vs unix/mac/linux.=20
>>
>> =E2=80=8ECross platform seems nice, but if a user tpes "*.*" into a cust=
om Open=20
>> File dialog, I might want (as the user probably expects) per-platform=20
>> behaviour.=20
>>
>>
>>
>> Sent from my BlackBerry portable Babbage Device
>> *From: *Morwenn
>> *Sent: *Wednesday, June 8, 2016 4:53 AM
>> *To: *ISO C++ Standard - Future Proposals
>> *Reply To: *std-pr...@isocpp.org <javascript:>
>> *Subject: *[std-proposals] File globbing in the standard library
>>
>> The C++17 standard filesystem library would benefit from a generic file=
=20
>> globbing utility, which is a really common operation when dealing with=
=20
>> files.
>> Here is a brief description of how I would envision it:
>>
>>    - Add a glob dialect to the regular expression libraries (with=20
>>    standard jokers, including **).
>>    - Add a glob function to path (or somewhere else) taking an std::rege=
x.
>>    - Add overloads to glob for std::string, std::string_view, const char=
*=20
>>    that default to the newly introduced glob dialect.
>>
>> I guess that the string types mentioned above would use=20
>> std::filesystem::path::value_type for their value type.
>>
>> I believe that using std::regex allows to have a truly generic globbing=
=20
>> interface, while defaulting to a regular glob dialect provides the=20
>> behaviour people expect by default for a glob function.
>>
>> Any thoughts about such a design?
>>
>> --=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit=20
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2=
f7-46d1-b1e0-e5493195fa28%40isocpp.org=20
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d=
2f7-46d1-b1e0-e5493195fa28%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>>

--=20
OpenPGP:

Public Key:   http://openpgp.klammler.eu
Fingerprint:  2732 DA32 C8D0 EEEC A081  BE9D CF6C 5166 F393 A9C0

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/87y45zcxob.fsf%40gmail.com.

.