220 28295 <2d8cf6fa-76f0-4147-bada-771f836bc435@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Jens_=C3=85kerblom?= <akerblom.jens@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Filesystem Library and Standardized Paths
Date: Tue, 20 Sep 2016 01:25:33 -0700 (PDT)
Lines: 202
Approved: news@gmane.org
Message-ID: <2d8cf6fa-76f0-4147-bada-771f836bc435@isocpp.org>
References: <316e66e9-764b-40da-bffc-e0ce2ed75ddd@isocpp.org>
 <nrh28q$mir$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4536_1518325317.1474359933184"
X-Trace: blaine.gmane.org 1474359958 28197 195.159.176.226 (20 Sep 2016 08:25:58 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 20 Sep 2016 08:25:58 +0000 (UTC)
Cc: mwoehlke.floss@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC2YT3FOXEIBB7XEQO7QKGQEFUNHR7Q@isocpp.org Tue Sep 20 10:25:54 2016
Return-path: <std-proposals+bncBC2YT3FOXEIBB7XEQO7QKGQEFUNHR7Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f70.google.com ([209.85.214.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC2YT3FOXEIBB7XEQO7QKGQEFUNHR7Q@isocpp.org>)
	id 1bmGMy-0004qD-L1
	for gclcip-std-proposals@m.gmane.org; Tue, 20 Sep 2016 10:25:36 +0200
Original-Received: by mail-it0-f70.google.com with SMTP id e20sf33112430itc.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 20 Sep 2016 01:25:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=6FcGjyrhzjkRUBctxdq4Hc+DMx86uHo9jYc3j/9dsls=;
        b=oKHAL6OJFk8ffzZWEr82vyOBaZOkgL/5mhnKMdgEot1b4WXEGnuwhZ+jDT6eG9A6cP
         t3qXqIVi4wqnr0LLhbCHx8Mn8nmFE66zsHn8zWFTC111JOcdfZfmz8E5rdNVJM0KZzpd
         R6NBqNxX19Yqw+z3KDlXpY7YUI+oNw2vsNIUe1E7EtlqIWQay9ThPFUvL5XVD4qLz3TH
         8Pd3UHMmQkcwGgqttK/+mYn0EVFzsgIQKVte5YMylzEEpAcpvlY9ysVyXyMIdL+3+KeT
         Bu86VNv/tG38xfZDxU2HOhOAn0AoNlYjhNhZZfrUiSewOmO2nKXqEf9o0QSXeWoL/sTg
         dI7w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=6FcGjyrhzjkRUBctxdq4Hc+DMx86uHo9jYc3j/9dsls=;
        b=Yvkbi6azbXogIXD6TJAHCVfeBfXVp/CWzgFsmHfpT9PmMAun8l0sFlhmaWY+XiTCzf
         AGtxmwkDNtisl5QEyLId2LsAYNnbRdzBKc/W086AxE4gy2OWkMKH2+mFiRmhexYPbl15
         E6LK+5QQe+B9j4DpkqPGpvAIZoCAQr0nCFPTfNBxzG6Z0rZNp2nu6ybjWUKY10V51gP9
         FfrIdLeWX8CCSYEnIrRgtxyaSEeWoL85RKXvmSs9uW9mHlLq70ejC5ukHuIsFObX42OD
         E1bIfrNMJYR8UMWdGba2shxKA7ehn1YekCAjJAnBcmfg6iy+sOMtKFw0IhuJU2GxT7Oq
         y1Fw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=6FcGjyrhzjkRUBctxdq4Hc+DMx86uHo9jYc3j/9dsls=;
        b=eTVOq4TcA7JOOnKWFxIgmRDsBvC0J3CoPoG8AuPnSbcQQLnL1x82tva/VkQjTd+OMR
         mZpNsVPDNuwU3Cc7PsADc7O0hjFRn69LcbsM+FGFhM628wbK3nLf8FpD9JN5yAiM2EUc
         MmkXF7lBlN/bExfftzQffryvr4SeF4aEzlobmvKmx1nN+krkt0LtQsiSmbQPiOZUnIY1
         sZ83AeP9u4LsB/1spv0ft77u7wJIUfsyxGHfVVJGvesNGStkbXclK9qvujNjKwglYKmH
         Yl2Q4mqxdqz0fsCkUBOEK0arXhBPJzhU98c6sP3jqQfhSmQrn4/DUf2/B1gET4LLy9Fs
         QSaQ==
X-Gm-Message-State: AE9vXwMz3i4mCdOV3crfQYGy5/UUd7UO2dhaO8x2Wi0LRc0ixSyCgKR5V3pufIhqIiWDAw==
X-Received: by 10.36.60.15 with SMTP id m15mr655647ita.5.1474359937863;
        Tue, 20 Sep 2016 01:25:37 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.211.20 with SMTP id n20ls1986488itg.12.canary; Tue, 20 Sep
 2016 01:25:34 -0700 (PDT)
X-Received: by 10.36.60.150 with SMTP id m144mr60920ita.1.1474359934369;
        Tue, 20 Sep 2016 01:25:34 -0700 (PDT)
In-Reply-To: <nrh28q$mir$1@blaine.gmane.org>
X-Original-Sender: akerblom.jens@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:28295
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28295>

------=_Part_4536_1518325317.1474359933184
Content-Type: multipart/alternative; 
	boundary="----=_Part_4537_2143730215.1474359933185"

------=_Part_4537_2143730215.1474359933185
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


>
> These may be simplifications. I would compare with existing prior art,=20
> e.g. http://doc.qt.io/qt-5/qstandardpaths.html.=20
>

Thank you for the QStandardPaths link, did not know that existed. This is=
=20
exactly what I'm hoping would end up in the standard (or at least some of=
=20
the paths). As I see it, any file operations in C++ must either use=20
current_path() or do their own platform dependent path lookup (or use third=
=20
party libraries to do it for them). Shifting the responsibility to write=20
these path lookups to the standard library writers would thus make it=20
easier to write platform independent code in my opinion.

Do you think this is worth taking forward by writing a proper proposal?

On Saturday, September 17, 2016 at 6:12:10 PM UTC+3, Matthew Woehlke wrote:
>
> On 2016-09-11 11:19, Jens =C3=85kerblom wrote:=20
> > Hello there,=20
> >=20
> > I've been looking through the proposed C++17 Filesystem library and=20
> thought=20
> > it would be a nice add-on to have common paths. The only path I see tha=
t=20
> is=20
> > already present is the *std::filesystem::temp_directory_path*. The=20
> > directories of interest (as I see) would be=20
> >=20
> >    - *executable_directory_path*, *installed_directory_path* or maybe a=
=20
> >    better name, *bundle_directory_path*, directory where the executable=
=20
> is=20
> >    being run / has been installed. Assumed to be read-only.=20
>
> I don't think you can implement this without platform support. That=20
> support *might* already be available on common platforms, but then again=
=20
> it might not.=20
>
> Implementing it for example on Linux requires digging around in /proc.=20
> Specifically, you need something like https://github.com/gpakosz/whereami=
..=20
>
>
> >    - *userdata_directory_path*, directory where current user stores=20
> data,=20
> >    "My Documents" on Windows for example. Assume permission required to=
=20
> write=20
> >    and read.=20
> >    - *cache_directory_path*, directory to data that persists longer tha=
n=20
> in=20
> >    *temp_diretory_path*, can be removed by OS if deemed necessary.=20
> >    "Library/Cache" on iOS for example. Assume write and read permission=
..=20
> >    - *appdata_directory_path*, directory where the application can stor=
e=20
> >    persistent data not to be shared with other application.=20
> >    "/data/data/<package_name>" on Android for example. Assume write and=
=20
> read=20
> >    permissions.=20
>
> These may be simplifications. I would compare with existing prior art,=20
> e.g. http://doc.qt.io/qt-5/qstandardpaths.html.=20
>
> --=20
> Matthew=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/2d8cf6fa-76f0-4147-bada-771f836bc435%40isocpp.or=
g.

------=_Part_4537_2143730215.1474359933185
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border-lef=
t: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class=3D"gmail_quote">=
These may be simplifications. I would compare with existing prior art,
<br>e.g. <a href=3D"http://doc.qt.io/qt-5/qstandardpaths.html" target=3D"_b=
lank" rel=3D"nofollow">http://doc.qt.io/qt-5/<wbr>qstandardpaths.html</a>.
<br></blockquote><br>Thank you for the QStandardPaths link, did not know th=
at existed. This is exactly what I&#39;m hoping would end up in the standar=
d (or at least some of the paths). As I see it, any file operations in C++ =
must either use current_path() or do their own platform dependent path look=
up (or use third party libraries to do it for them). Shifting the responsib=
ility to write these path lookups to the standard library writers would thu=
s make it easier to write platform independent code in my opinion.<br><br>D=
o you think this is worth taking forward by writing a proper proposal?<br><=
br>On Saturday, September 17, 2016 at 6:12:10 PM UTC+3, Matthew Woehlke wro=
te:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;=
border-left: 1px #ccc solid;padding-left: 1ex;">On 2016-09-11 11:19, Jens =
=C3=85kerblom wrote:
<br>&gt; Hello there,
<br>&gt;=20
<br>&gt; I&#39;ve been looking through the proposed C++17 Filesystem librar=
y and thought=20
<br>&gt; it would be a nice add-on to have common paths. The only path I se=
e that is=20
<br>&gt; already present is the *std::filesystem::temp_<wbr>directory_path*=
.. The=20
<br>&gt; directories of interest (as I see) would be
<br>&gt;=20
<br>&gt; =C2=A0 =C2=A0- *executable_directory_path*, *installed_directory_p=
ath* or maybe a=20
<br>&gt; =C2=A0 =C2=A0better name, *bundle_directory_path*, directory where=
 the executable is=20
<br>&gt; =C2=A0 =C2=A0being run / has been installed. Assumed to be read-on=
ly.
<br>
<br>I don&#39;t think you can implement this without platform support. That
<br>support *might* already be available on common platforms, but then agai=
n
<br>it might not.
<br>
<br>Implementing it for example on Linux requires digging around in /proc.
<br>Specifically, you need something like <a href=3D"https://github.com/gpa=
kosz/whereami" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=
=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fgpakosz%=
2Fwhereami\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGICiAAARywF8gktr6CKDFr2g=
saAw&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.google.com/=
url?q\x3dhttps%3A%2F%2Fgithub.com%2Fgpakosz%2Fwhereami\x26sa\x3dD\x26sntz\x=
3d1\x26usg\x3dAFQjCNGICiAAARywF8gktr6CKDFr2gsaAw&#39;;return true;">https:/=
/github.com/gpakosz/<wbr>whereami</a>.
<br>
<br>&gt; =C2=A0 =C2=A0- *userdata_directory_path*, directory where current =
user stores data,=20
<br>&gt; =C2=A0 =C2=A0&quot;My Documents&quot; on Windows for example. Assu=
me permission required to write=20
<br>&gt; =C2=A0 =C2=A0and read.
<br>&gt; =C2=A0 =C2=A0- *cache_directory_path*, directory to data that pers=
ists longer than in=20
<br>&gt; =C2=A0 =C2=A0*temp_diretory_path*, can be removed by OS if deemed =
necessary.=20
<br>&gt; =C2=A0 =C2=A0&quot;Library/Cache&quot; on iOS for example. Assume =
write and read permission.
<br>&gt; =C2=A0 =C2=A0- *appdata_directory_path*, directory where the appli=
cation can store=20
<br>&gt; =C2=A0 =C2=A0persistent data not to be shared with other applicati=
on.=20
<br>&gt; =C2=A0 =C2=A0&quot;/data/data/&lt;package_name&gt;&quot; on Androi=
d for example. Assume write and read=20
<br>&gt; =C2=A0 =C2=A0permissions.
<br>
<br>These may be simplifications. I would compare with existing prior art,
<br>e.g. <a href=3D"http://doc.qt.io/qt-5/qstandardpaths.html" target=3D"_b=
lank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.google.co=
m/url?q\x3dhttp%3A%2F%2Fdoc.qt.io%2Fqt-5%2Fqstandardpaths.html\x26sa\x3dD\x=
26sntz\x3d1\x26usg\x3dAFQjCNFy3SI69fCG6NqmmErbL0NXcYoggQ&#39;;return true;"=
 onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdo=
c.qt.io%2Fqt-5%2Fqstandardpaths.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQj=
CNFy3SI69fCG6NqmmErbL0NXcYoggQ&#39;;return true;">http://doc.qt.io/qt-5/<wb=
r>qstandardpaths.html</a>.
<br>
<br>--=20
<br>Matthew
<br>
<br></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/2d8cf6fa-76f0-4147-bada-771f836bc435%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2d8cf6fa-76f0-4147-bada-771f836bc435=
%40isocpp.org</a>.<br />

------=_Part_4537_2143730215.1474359933185--

------=_Part_4536_1518325317.1474359933184--

.
