-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathn4080.html
1576 lines (1274 loc) · 57.7 KB
/
n4080.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta charset="utf-8">
<title>File System Immediate Issues</title>
<style type="text/css">
p {text-align:justify}
li {text-align:justify}
blockquote.note
{
background-color:#E0E0E0;
padding-left: 15px;
padding-right: 15px;
padding-top: 1px;
padding-bottom: 1px;
}
ins {background-color:#A0FFA0}
del {background-color:#FFA0A0}
</style>
</head>
<body>
<table>
<tr>
<td align="left">Doc. no.</td>
<td align="left">N4080</td>
</tr>
<tr>
<td align="left">Date:</td>
<td align="left">2014-06-20</td>
</tr>
<tr>
<td align="left">Project:</td>
<td align="left">File System TS</td>
</tr>
<tr>
<td align="left">Reply to:</td>
<td align="left">Beman Dawes <<a href="mailto:bdawes at acm dot org">bdawes at acm dot org</a>></td>
</tr>
</table>
<h1>File System TS Immediate Issues for Rapperswil</h1>
<p><p>Revised 2014-06-20 at 09:06:18 UTC</p>
</p>
<p>Reference ISO/IEC TS 18822</p>
<hr>
<h3><a name="5"></a>5. [PDTS] Parent of root directory unspecified</h3>
<p><b>Section:</b> X 8.1 [path.generic] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> CH-4 <b>Opened:</b> 2014-01-20 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>8.1 [path.generic] says:
"The filename dot-dot is treated as a reference to the parent directory." So it must be
specified what "/.." and "/../.." refer to.</p>
<p>Add a statement what the parent directory of the root directory is.</p>
<p><i>[2014-02-07, Beman Dawes suggests wording]</i></p>
<p><i>[
2014-02-11 Issaquah: Implementation defined. See wiki notes for rationale.
Beman to provide wording for review next meeting.
]</i></p>
<p><i>[
22 May 2014 Beman provides wording, taken directly from POSIX.
See pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_12
]</i></p>
<p><b>Proposed resolution:</b></p>
<ol>
<li>
<p>Change 8.1 [path.generic]:</p>
<blockquote><p>
The filename <i>dot</i> is treated as a reference to the current directory.
The filename <i>dot-dot</i> is treated as a reference to the parent directory.
<ins>What the filename <i>dot-dot</i> refers to relative to <i>root-directory</i> is implementation-defined.</ins>
Specific filenames may have special meanings for a particular operating system.
</p></blockquote>
</li>
</ol>
<hr>
<h3><a name="22"></a>22. [PDTS] <tt>directory_iterator</tt> underspecified</h3>
<p><b>Section:</b> X 13.1 [directory_iterator.members] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> CH-13 <b>Opened:</b> 2014-01-20 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>The behaviour of increment is underspecified: What happens if the implementation
detects an endless loop (e.g. caused by links)? What happens with automounting and
possible race conditions?</p>
<p>More information on this can be found <a href="http://man7.org/linux/manpages/man3/fts.3.html">here</a>.
<p>Suggested action:</p>
<p>Specify the required behaviour in these cases.</p>
</p>
<p><i>[2014-02-13 LWG/SG-3 Issaquah: STL will provide wording for next meeting for
the endless loop case. The other cases are covered by existing wording in the front matter.]</i></p>
<p><i>[17 Jun 2014 At the request of the LWG, Beman provides wording for a note.]</i></p>
<p><b>Proposed resolution:</b></p>
<p>
<i>In 14 Class recursive_directory_iterator [class.rec.dir.itr], add:</i>
</p>
<blockquote>
<p>
<ins>
[<i>Note: </i>If the directory structure being iterated over contains
cycles then
the end iterator may be unreachable. <i>--end note</i>]
</ins>
</p>
</blockquote>
<hr>
<h3><a name="25"></a>25. [PDTS] Copying equivalent paths effects not specified</h3>
<p><b>Section:</b> X 15.4 [fs.op.copy_file] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> CH-15 <b>Opened:</b> 2014-01-20 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>Even if <tt>to</tt> and <tt>from</tt> are different paths, they may be equivalent.</p>
<p>Specify what happens if <tt>(options & copy_options::overwrite_existing)</tt> but <tt>from</tt> and <tt>to</tt>
resolve to the same file.</p>
<p><i>[2014-02-09, Beman Dawes: Need advice on this issue:]</i></p>
<p/>What do existing implentations do?
<p/>Possible resolutions:
<ol>
<li>Treat it as an error.</li>
<li>Once equivalence is determined, take no further action and return true? false?</li>
<li>Don't bother to detect a file overwriting itself. This will likely result in an error, anyhow.</li>
</ol>
<p><i>[2014-02-13 LWG/SG-3 Issaquah: LWG/SG-3 decided to treat equivalence in this case as an error.
Beman to provide wording.]</i></p>
<p><i>[2014-04-09 Beman provided wording as requested. The Effects were rewritten to increase
clarity. Behavior remains unchanged except for treating equivalence as an error.]</i></p>
<p><i>[17 Jun 2014 Rapperswil LWG moves to Immediate. Jonathan Wakely will provide editorial
changes to improve the presentation of bitmask values.]</i></p>
<p><b>Proposed resolution:</b></p>
<p/>
<i>Change 15.4 [fs.op.copy_file]:</i>
<blockquote>
<p>
<i>Precondition:</i> At most one constant from each <code>copy_options</code>
option group ([<a href="#enum.copy_options">enum.copy_options</a>]) is present
in <code>options</code>.
</p>
<p>
<i>Effects:</i>
</p>
<blockquote>
<p><del>
If <code>exists(to) &&</code> <code>
!(options & (copy_options::skip_existing
| copy_options::overwrite_existing | copy_options::update_existing))
</code> report a
file already exists error as specified in <a href="#Error-reporting">Error reporting (7)</a>.
</del></p>
<p><del>
If <code>
!exists(to) || (options & copy_options::overwrite_existing) || ((options & copy_options::update_existing)
&& last_write_time(from) > last_write_time(to)) || !(options & (copy_options::skip_existing
| copy_options::overwrite_existing | copy_options::update_existing))
</code> copy the contents and attributes of the file <code>from</code>
resolves to the file <code>to</code> resolves to.
</del></p>
</blockquote>
<blockquote>
<p>
<ins>
Report a file already exists error as specified in
<a href="file:///C:/dot16/filesystem-ts/working-draft.html#Error-reporting">
Error reporting (7)
</a> if:
</ins>
</p>
<ul>
<li><ins>
<ins><code>exists(to)</code> and <code>equivalent(from, to)</code>,
or</ins>
</ins></li>
<li><ins>
<code>exists(to)</code> and <code>
(options & (copy_options::skip_existing
| copy_options::overwrite_existing | copy_options::update_existing)) == copy_options::none.
</code>
</ins></li>
</ul>
<p><ins>
Otherwise copy the contents and attributes of the file <code>from</code>
resolves to to the file <code>to</code> resolves to if:
</ins></p>
<ul>
<li><ins>
<code>!exists(to)</code>, or
</ins></li>
<li><ins>
<code>exists(to)</code> and <code>
(options &
copy_options::overwrite_existing) != copy_options::none
</code>, or
</ins></li>
<li><ins>
<code>exists(to)</code> and <code>
(options &
copy_options::update_existing) != copy_options::none
</code> and <code>from</code> is more
recent than <code>to</code>, determined as if by use of the <code>
last_write_time
</code> function.
</ins></li>
</ul>
<p><ins>Otherwise no effects.</ins></p>
</blockquote>
<p>
<i>Returns</i>: <code>true</code> if the <code>from</code> file
was copied, otherwise <code>false</code>. The signature with argument <code>ec</code> return
<code>false</code> if an error occurs.
</p>
<p>
<i>Throws:</i> As specified in <a href="#Error-reporting">Error reporting (7)</a>.
</p>
<p>
<i>Complexity:</i> At most one direct or indirect invocation of <code>
status(to)</code>.
</p>
</blockquote>
<hr>
<h3><a name="27"></a>27. [PDTS] Return value of <tt>uintmax_t</tt> on error?</h3>
<p><b>Section:</b> X 15.14 [fs.op.file_size] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> FI-9 <b>Opened:</b> 2014-01-20 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>"The signature with argument <tt>ec</tt> returns <tt>static_cast<uintmax_t>(-1)</tt> if an error
occurs.", one would expect that <b>both</b> signatures return that if an error occurs?</p>
<p>Clarify the Returns clause, and apply the same for every function that returns an
<tt>uintmax_t</tt> where applicable.</p>
<p><i>[2014-02-13 LWG/SG-3 Issaquah:]</i></p>
<p/>Discussion when around in circles for a while, until someone suggested the reference to 15.15 was wrong,
and that the issue applied to the previous function in the WP, 15.14 File size [fs.op.file_size].
<p/>The NB Comment makes much more sense if it applies to file_size(), so the chair was directed
to change the reference from 15.15 [fs.op.hard_lk_ct] to 15.14 [fs.op.file_size].
<p/>The intent that file_size() is only meaningful for regular_files. Beman to strike the
the static_cast, changing it to "Otherwise an error is reported.".
<p><b>Proposed resolution:</b></p>
<p>
<i>Change 15.14 [fs.op.file_size]:</i>
</p>
<pre>uintmax_t file_size(const path& p);
uintmax_t file_size(const path& p, error_code& ec) noexcept;</pre>
<blockquote>
<p><i>Returns:</i> If <code>
<ins>!</ins>exists(p) <del>&&</del> <ins>|| !</ins>is_regular_file(p)</code><ins>
an error is reported (7). Otherwise</ins>, the size in bytes
of the file <code>p</code> resolves to, determined as if by the value of the
POSIX <code>stat</code> structure member <code>st_size</code>
obtained as if by POSIX <code>stat()</code>.
<del>Otherwise, <code>static_cast<uintmax_t>(-1)</code>.</del> The signature with
argument <code>ec</code>
returns <code>static_cast<uintmax_t>(-1)</code> if an error occurs.</p>
<p><i>Throws:</i> As specified in <a href="#Error-reporting">Error reporting <ins>(7)</ins></a>.</p>
</blockquote>
<hr>
<h3><a name="34"></a>34.
[PDTS] <tt>enum class directory_options</tt> has no summary
</h3>
<p><b>Section:</b> X 6 [fs.filesystem.synopsis] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-19</p>
<p><b>View other</b> <a href="open-index.html# [fs.filesystem.synopsis">active issues</a> in 6 [fs.filesystem.synopsis].</p>
<p><b>View all other</b> <a href="section-index.html# [fs.filesystem.synopsis">issues</a> in 6 [fs.filesystem.synopsis].</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p><tt>enum class directory_options</tt> has no summary.</p>
<p><b>Proposed resolution:</b></p>
<p>
<i>Change 6 [fs.filesystem.synopsis]:</i>
</p>
<blockquote>
<pre> enum class directory_options<ins>;</ins>
<del>{</del>
<del>none,</del>
<del>follow_directory_symlink,</del>
<del>skip_permission_denied</del>
<del>};</del></pre>
</blockquote>
<p>
<i>Add the following sub-section:</i>
</p>
<blockquote>
<h3>
10.4 Enum class <code>directory_options</code> [<a name="enum.directory_options">enum.directory_options</a>]
</h3>
<p>
The <tt>enum class</tt> type <code>directory_options</code>
is a bitmask type (C++11 §17.5.2.1.3) that specifies bitmask constants used to identify
directory traversal options.
</p>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td>
<b>Name</b>
</td>
<td align="center">
<b>Value</b>
</td>
<td>
<b>Meaning</b>
</td>
</tr>
<tr>
<td>
<code>none</code>
</td>
<td align="center">
<code>0</code>
</td>
<td>(Default) Skip directory symlinks, permission denied is error.</td>
</tr>
<tr>
<td>
<code>follow_directory_symlink</code>
</td>
<td align="center">
<code>1</code>
</td>
<td> Follow rather than skip directory symlinks.</td>
</tr>
<tr>
<td>
<code>skip_permission_denied</code>
</td>
<td align="center">
<code>2</code>
</td>
<td> Skip directories that would otherwise result in permission denied errors.</td>
</tr>
</table>
</blockquote>
<hr>
<h3><a name="35"></a>35. [PDTS] <tt>directory_options::skip_permission_denied</tt> is not used</h3>
<p><b>Section:</b> X 6 [fs.filesystem.synopsis] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-19</p>
<p><b>View other</b> <a href="open-index.html# [fs.filesystem.synopsis">active issues</a> in 6 [fs.filesystem.synopsis].</p>
<p><b>View all other</b> <a href="section-index.html# [fs.filesystem.synopsis">issues</a> in 6 [fs.filesystem.synopsis].</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<tt>directory_options::skip_permission_denied</tt> is not used.
</p>
<p><i>[2014-04-13 Beman: <tt>skip_permissions_denied</tt> not being used is a
symptom of a more serious problem; two <tt>directory_itorator</tt> constructors
are missing <tt>directory_options</tt> arguments and a description of how they
are used. Proposed wording provided.]</i></p>
<p><i>[17 Jun 2014 LWG requests two signatures rather than one with default argument. Beman updates wording.]</i></p>
<p><b>Proposed resolution:</b></p>
<p>
<i>Change 13 [class.directory_iterator]:</i>
</p>
<blockquote>
<pre> directory_iterator() noexcept;
explicit directory_iterator(const path& p);
<ins>directory_iterator(const path& p, directory_options options</ins>);
directory_iterator(const path& p, error_code& ec) noexcept;
<ins>directory_iterator(const path& p,</ins>
<ins>directory_options options, error_code& ec) noexcept;</ins>
directory_iterator(const directory_iterator&) = default;
directory_iterator(directory_iterator&&) = default;
~directory_iterator();
</pre>
</blockquote>
<p>
<i>Change 13.1 directory_iterator members [directory_iterator.members]:</i>
</p>
<blockquote>
<pre> explicit directory_iterator(const path& p);
<ins>directory_iterator(const path& p, directory_options options</ins>);
directory_iterator(const path& p, error_code& ec) noexcept;
<ins>directory_iterator(const path& p,</ins>
<ins>directory_options options, error_code& ec) noexcept;</ins>
</pre>
<p>
<i>Effects:</i> For the directory that <code>p</code> resolves to,
constructs an iterator for the first element in a sequence of <code>
directory_entry
</code> elements representing the files in the directory, if
any; otherwise the end iterator.
</p>
<p>
<ins>
However, if <code>options & directory_options::skip_permissions_denied != directory_options::none</code>
and construction encounters an error indicating that permission to access
<code>p</code> is denied, constructs the end iterator and does not report an
error.
</ins>
</p>
</blockquote>
<p>
<i>
Change 14 <a name="Class-recursive_directory_iterator">
Class <code>recursive_directory_iterator</code>
[class.rec.dir.itr]
</a>:
</i>
</p>
<blockquote>
<pre> explicit recursive_directory_iterator(const path& p<del>,</del>
<del>directory_options options = directory_options::none</del>);
<ins>recursive_directory_iterator(const path& p, directory_options options);</ins>
recursive_directory_iterator(const path& p,
directory_options options, error_code& ec) noexcept;
recursive_directory_iterator(const path& p, error_code& ec) noexcept;
</pre>
</blockquote>
<p>
<i>Change 14.1 recursive_directory_iterator members [rec.dir.itr.members]:</i>
</p>
<blockquote>
<pre> explicit recursive_directory_iterator(const path& p<del>,</del>
<del>directory_options options = directory_options::none</del>);
<ins>recursive_directory_iterator(const path& p, directory_options options);</ins>
recursive_directory_iterator(const path& p,
directory_options options, error_code& ec) noexcept;
recursive_directory_iterator(const path& p, error_code& ec) noexcept;
</pre>
<p>
<i>Effects:</i> Constructs a iterator representing the first entry in the
directory <code>p</code> resolves to, if any; otherwise, the end iterator.
</p>
<p>
<ins>
However, if <code>options & directory_options::skip_permissions_denied != directory_options::none</code>
and construction encounters an error indicating that permission to access
<code>p</code> is denied, constructs the end iterator and does not report an
error.
</ins>
</p>
</blockquote>
<p>
<i>Change 14.1 recursive_directory_iterator members [rec.dir.itr.members]:</i>
</p>
<blockquote>
<pre> recursive_directory_iterator& operator++();
recursive_directory_iterator& increment(error_code& ec);
</pre>
<p>
<i>Requires:</i> <code>*this != recursive_directory_iterator()</code>.
</p>
<p>
<i>Effects:</i> As specified by C++11 § 24.1.1 Input iterators, except
that:
</p>
<ul>
<li>
If there are no more entries at this depth, then if <code>depth()!= 0</code>
iteration over the parent directory resumes; otherwise <code>
*this =
recursive_directory_iterator()
</code>.
</li>
<li>
Otherwise if <code>
recursion_pending() && is_directory(this->status())
&& (!is_symlink(this->symlink_status()) || (options() &
directory_options::follow_directory_symlink) != <del>0</del> <ins>directory_options::none</ins>)
</code> then <ins>either</ins> directory
<code>(*this)->path()</code> is recursively iterated into
<ins>
or, if <code>
options() & directory_options::skip_permissions_denied != directory_options::none
</code>
and an error occurs indicating that permission to access directory
<code>(*this)->path()</code> is denied, then directory <code>(*this)->path()</code> is
treated as an empty directory and no error is reported
</ins>.
</li>
</ul>
</blockquote>
<hr>
<h3><a name="36"></a>36. [PDTS] <tt>copy_options::copy_symlinks</tt> is not used</h3>
<p><b>Section:</b> X 10.2 [enum.copy_options] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all other</b> <a href="section-index.html#0.2 [enum.copy_options">issues</a> in 10.2 [enum.copy_options].</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<tt>copy_options::copy_symlinks</tt> is not used (should test it before calling <tt>copy_symlinks</tt> in <tt>copy</tt>).
</p>
<p><i>[20 May 2014 Beman Dawes provides proposed wording.]</i></p>
<p><b>Proposed resolution:</b></p>
<p>
<i>Change 15.3 Copy [fs.op.copy]:</i>
</p>
<blockquote>
<blockquote>
<p>
If <code>is_symlink(f)</code>, then:
</p>
<ul>
<li>
If <code>options & copy_options::skip_symlinks</code>, then return.
<span style="font-style: italic; background-color: #C0C0C0">Missing != copy_options::none fixed by issue 59</span>
</li>
<li>
Otherwise if <code>
!exists(t) <ins>
&& (options & copy_options::copy_symlinks)
!= copy_options::none
</ins>
</code>, then <code>
copy_symlink(from,
to, options)
</code>.
</li>
<li>
Otherwise report an error as specified in
<a href="file:///C:/dot16/filesystem-ts/issues/mailing/active.html#Error-reporting"
style="color: #2020FF; text-decoration: none">
Error reporting (7)
</a>.
</li>
</ul>
</blockquote>
</blockquote>
<hr>
<h3><a name="37"></a>37. [PDTS] All functions with <tt>error_code</tt> arguments should be <tt>noexcept</tt></h3>
<p><b>Section:</b> X 15.2 [fs.op.canonical], X 15.11 [fs.op.current_path], X 15.27 [fs.op.read_symlink], X 15.36 [fs.op.system_complete], X 15.37 [fs.op.temp_dir_path], X 15.38 [fs.op.unique_path], X 8.4 [path.member] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
all functions with <tt>error_code</tt> arguments should be <tt>noexcept</tt>
(see <tt>canonical</tt>, <tt>current_path</tt>, <tt>read_symlink</tt>, <tt>system_complete</tt>,
<tt>temp_directory_path</tt>, <tt>unique_path</tt>, plus member functions).
</p>
<p><i>[2014-02-03: Stephan T. Lavavej comments:]</i></p>
<p>The declaration and definition of
"<tt>recursive_directory_iterator& increment(error_code& ec);</tt>" should almost certainly
be marked noexcept.</p>
<p><i>[2014-02-08: Daniel comments]</i></p>
<p>
All functions that return a <tt>path</tt> value such as <tt>canonical</tt>, <tt>current_path</tt>,
<tt>read_symlink</tt>, <tt>system_complete</tt>, <tt>temp_directory_path</tt>, <tt>unique_path</tt>,
or any member function returning a <tt>path</tt> value or <tt>basic_string</tt> value might legally
throw an exception, if the allocator of the underlying string complains about insufficient
memory. This is an anti-pattern for <tt>noexcept</tt>, because the exception-specification includes
the return statement of a function and given the fact that the language currently does declare RVO
as an optional action, we cannot rely on it.
<p/>
The Standard is currently very careful <em>not</em> to specify functions as <tt>noexcept</tt>,
if this case can happen, see e.g. <tt>std::locale::name()</tt>. To the contrary, enforcing them to be
<tt>noexcept</tt>, would cause a similar problem as the unconditional <tt>noexcept</tt> specifier of
the value-returning <tt>kill_dependency</tt> as denoted by LWG 2236.
<p/>
Basically this requirement conflicts with the section "Adopted Guidelines", second bullet of
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3279.pdf">N3279</a>.
</p>
<p><i>[Beman Dawes 2014-02-27]</i></p>
<p/>Issues <a href="active.html#37">37</a>,
<a href="active.html#38">38</a>,
<a href="active.html#41">41</a>,
and <a href="active.html#49">49</a> are concerned with signatures which should or should not
be <tt>noexcept</tt>. I will provide unified proposed wording for these issues, possibly in a separate paper.
<p><i>[21 May 2014 Beman Dawes reviewed all functions with <code>error_code&</code> arguments,
and provided proposed wording for the one case found where the above guidelines were not met.
This was the case previously identified by Stephan T. Lavavej.
]</i></p>
<p><b>Proposed resolution:</b></p>
<p>
<i>Change 14 Class recursive_directory_iterator [class.rec.dir.itr]:</i>
</p>
<blockquote>
<pre>recursive_directory_iterator& increment(error_code& ec) <ins>noexcept</ins>;</pre>
</blockquote>
<p>
<i>Change 14.1 recursive_directory_iterator members [rec.dir.itr.members]:</i>
</p>
<blockquote>
<pre>recursive_directory_iterator& increment(error_code& ec) <ins>noexcept</ins>;</pre>
</blockquote>
<hr>
<h3><a name="40"></a>40. [PDTS] <tt>class directory_entry</tt> should retain <tt>operator const path&()</tt> from V2</h3>
<p><b>Section:</b> X 12 [class.directory_entry] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-17</p>
<p><b>View other</b> <a href="open-index.html#2 [class.directory_entry">active issues</a> in 12 [class.directory_entry].</p>
<p><b>View all other</b> <a href="section-index.html#2 [class.directory_entry">issues</a> in 12 [class.directory_entry].</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<tt>class directory_entry</tt> should retain <tt>operator const path&()</tt> from V2.
</p>
<p><i>[2014-05-19 Beman Dawes supplied proposed wording.]</i></p>
<p><i>[2014-06-02 Beman Dawes provides rationale:]</i></p>
<blockquote>
This conversion operator was removed when <code>status()</code> and <code>symlink_status()</code>
were added during the transition from V2 to V3 as it seemed a bit unusual to have a conversion
operator for one of the several values held. Users complained as they had found the
automatic conversion convenient in the most common <code>directory_entry</code> use case.
</blockquote>
<p><i>[17 Jun 2014 Rapperswil LWG discusses in depth, accepts proposed wording.]</i></p>
<p><b>Proposed resolution:</b></p>
<p>
<i>Change 12 Class directory_entry [class.directory_entry]:</i>
</p>
<blockquote>
<pre>// observers
const path& path() const noexcept;
<ins>operator const path&() const noexcept;</ins>
file_status status() const;
file_status status(error_code& ec) const noexcept;
file_status symlink_status() const;
file_status symlink_status(error_code& ec) const noexcept;</pre>
</blockquote>
<p>
<i>Change 12.3 directory_entry observers [directory_entry.obs]:</i>
</p>
<blockquote>
<pre>const path& path() const noexcept;
<ins>operator const path&() const noexcept;</ins></pre>
<blockquote>
<p>
<i>Returns:</i>
<code>m_path</code>
</p>
</blockquote>
</blockquote>
<hr>
<h3><a name="41"></a>41. [PDTS] <tt>directory_iterator</tt>, <tt>recursive_directory_iterator</tt>, move construct/assign should be <tt>noexcept</tt></h3>
<p><b>Section:</b> X 13 [class.directory_iterator], X 14 [class.rec.dir.itr] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all other</b> <a href="section-index.html#3 [class.directory_iterator">issues</a> in 13 [class.directory_iterator].</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<tt>class directory_iterator</tt> move construct/assign should be <tt>noexcept</tt>.<br/>
<tt>class recursive_directory_iterator</tt> move construct/assign should be <tt>noexcept</tt>.
</p>
<p><i>[Beman Dawes 2014-02-27]</i></p>
<p/>Issues <a href="active.html#37">37</a>,
<a href="active.html#38">38</a>,
<a href="active.html#41">41</a>,
and <a href="active.html#49">49</a> are concerned with signatures which should or should not
be <tt>noexcept</tt>. I will provide unified proposed wording for these issues, possibly in a separate paper.
<p><i>[Daniel Krügler 2014-02-28]</i></p>
<pre>directory_iterator begin(directory_iterator iter) noexcept;
directory_iterator end(const directory_iterator&) noexcept;</pre>
<p/>are noexcept, but we have no guarantee that at least the
move-constructor is noexcept:
<pre>directory_iterator(const directory_iterator&) = default;
directory_iterator(directory_iterator&&) = default;</pre>
<p/>This means that either the above noexcept specifications are not
warranted or that at least the move-constructor of <tt>directory_iterator</tt>
is required to be noexcept.
<p/>The same applies to <tt>recursive_directory_iterator</tt>.
<p><i>[21 May 2014 Beman Dawes provided proposed resolution wording.]</i></p>
<p><i>[18 Jun 2014 "= default" removed per LWG discussion]</i></p>
<p><b>Proposed resolution:</b></p>
<p>
<i>Change 13 Class directory_iterator [class.directory_iterator]:</i></p>
<blockquote>
<pre>directory_iterator(const directory_iterator& <ins>rhs</ins>) <del>= default</del>;
directory_iterator(directory_iterator&& <ins>rhs</ins>) <ins>noexcept</ins> <del>= default</del>;
...
directory_iterator& operator=(const directory_iterator& <ins>rhs</ins>) <del>= default</del>;
directory_iterator& operator=(directory_iterator&& <ins>rhs</ins>) <ins>noexcept</ins> <del>= default</del>;</pre>
</blockquote>
<p/><i>To 13.1 directory_iterator members [directory_iterator.members] add:</i>
<blockquote>
<pre>directory_iterator(const directory_iterator& rhs);
directory_iterator(directory_iterator&& rhs) noexcept;</pre>
<blockquote>
<p>
<i>Effects:</i> Constructs an object of class <code>directory_iterator</code>.
</p>
<p>
<i>Postconditions:</i> <code>*this</code> has the original value of <code>rhs</code>.
</p>
</blockquote>
<pre>directory_iterator& operator=(const directory_iterator& rhs);
directory_iterator& operator=(directory_iterator&& rhs) noexcept;</pre>
<blockquote>
<p>
<i>Effects:</i>
If <code>*this</code> and <code>rhs</code> are the same object, the member has no effect.
</p>
<p>
<i>Postconditions:</i> <code>*this</code> has the original value of <code>rhs</code>.
</p>
<p/><i>Returns:</i>
<code>*this</code>.
</blockquote>
</blockquote>
<p>
<i>Change 14 Class recursive_directory_iterator [class.rec.dir.itr]:</i>
</p>
<blockquote>
<pre>recursive_directory_iterator(const recursive_directory_iterator& <ins>rhs</ins>) <del>= default</del>;
recursive_directory_iterator(recursive_directory_iterator&& <ins>rhs</ins>) <ins>noexcept</ins> <del>= default</del>;
...
recursive_directory_iterator& operator=(const recursive_directory_iterator& <ins>rhs</ins>) <del>= default</del>;
recursive_directory_iterator& operator=(recursive_directory_iterator&& <ins>rhs</ins>) <ins>noexcept</ins> <del>= default</del>;</pre>
</blockquote>
<p/>
<i>To 14.1 recursive_directory_iterator members [rec.dir.itr.members] add:</i>
<blockquote>
<pre>recursive_directory_iterator(const recursive_directory_iterator& rhs);</pre>
<blockquote>
<p>
<i>Effects:</i> Constructs an object of class <code>recursive_directory_iterator</code>.
</p>
<p>
<i>Postconditions:</i> <code>this->options() == rhs.options() && this->depth() ==
rhs.depth() && this->recursion_pending() ==
rhs.recursion_pending()</code>.
</p>
</blockquote>
<pre>recursive_directory_iterator(recursive_directory_iterator&& rhs) noexcept;</pre>
<blockquote>
<p>
<i>Effects:</i> Constructs an object of class <code>recursive_directory_iterator</code>.
</p>
<p>
<i>Postconditions:</i> <code>this->options()</code>, <code>this->depth()</code>, and
<code>this->recursion_pending()</code> return the values that
<code>rhs.options()</code>, <code>rhs.depth()</code>, and <code>rhs.recursion_pending()</code>,
respectively, had before the function call.
</p>
</blockquote>
<pre>recursive_directory_iterator& operator=(const recursive_directory_iterator& rhs);</pre>
<blockquote>
<p>
<i>Effects:</i>
If <code>*this</code> and <code>rhs</code> are the same object, the member has no effect.
</p>
<p>
<i>Postconditions:</i> <code>
this->options() == rhs.options() && this->depth() ==
rhs.depth() && this->recursion_pending() ==
rhs.recursion_pending()
</code>.
</p>
<p/><i>Returns:</i>
<code>*this</code>.
</blockquote>
<pre>recursive_directory_iterator& operator=(recursive_directory_iterator&& rhs) noexcept;</pre>
<blockquote>
<p>
<i>Effects:</i>
If <code>*this</code> and <code>rhs</code> are the same object, the member has no effect.
</p>
<p>
<i>Postconditions:</i>
<code>this->options()</code>, <code>this->depth()</code>, and
<code>this->recursion_pending()</code> return the values that
<code>rhs.options()</code>, <code>rhs.depth()</code>, and <code>rhs.recursion_pending()</code>,
respectively, had before the function call.
</p>
<p/><i>Returns:</i> <code>*this</code>.
</blockquote>
</blockquote>
<hr>
<h3><a name="45"></a>45.
[PDTS] <tt>create_directory</tt> should refer to <tt>perms::all</tt> instead of Posix
<tt>S_IRWXU|S_IRWXG|S_IRWXO</tt>
</h3>
<p><b>Section:</b> X 15.7 [fs.op.create_directory] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<tt>create_directory</tt> should refer to <tt>perms::all</tt> instead of the Posix
<tt>S_IRWXU|S_IRWXG|S_IRWXO</tt>.
</p>
<p><i>[2014-02-28 Beman provided proposed wording.]</i></p>
<p><b>Proposed resolution:</b></p>
<p><i>Effects:</i> Establishes the postcondition by attempting to create the
directory <code>p</code> resolves to, as if by POSIX <code>
mkdir()</code> with a second argument of <del>S_IRWXU|S_IRWXG|S_IRWXO</del> <ins><code>static_cast<int>(perms::all)</code></ins>. Creation
failure because <code>p</code> resolves to an existing directory shall not be
treated as an error. </p>
<hr>
<h3><a name="48"></a>48. [PDTS] <tt>path::template<class charT>string()</tt> conversion rules</h3>
<p><b>Section:</b> X 8.4.6 [path.native.obs] <b>Status:</b> <a href="active.html#Immediate">Immediate</a>
<b>Submitter:</b> P.J. Plauger <b>Opened:</b> 2014-01-30 <b>Last modified:</b> 2014-06-19</p>
<p><b>View all issues with</b> <a href="status-index.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<tt>path::template<class charT>string()</tt> should promise to convert by the same
rules as <tt>u16string</tt> for <tt>string<char16_t></tt>, etc. and one-for-one otherwise.
<p/>
What if <tt>charT</tt> is <tt>signed char</tt> (or even <tt>float</tt>)? I don't see where that choice
is disallowed, so we should either disallow it or make it be something that is quasi-sensible.
</p>
<p><i>[2014-02-08 Daniel comments]</i></p>
<p>
There are two relevant places in the wording that seem to clarify what is required here:
</p>
<ol>
<li><p>
Most importantly, 5 [fs.req] says:
</p>
<blockquote><p>
Throughout this Technical Specification, <tt>char</tt>, <tt>wchar_t</tt>, <tt>char16_t</tt>, and <tt>char32_t</tt>
are collectively called <em>encoded character types</em>.
<p/>
Template parameters named <tt>charT</tt> shall be one of the encoded character types.
<p/>
[…]
[<i>Note</i>: Use of an encoded character type implies an associated encoding. Since <tt>signed char</tt> and <tt>unsigned char</tt>
have no implied encoding, they are not included as permitted types. — <i>end note</i>]
</p></blockquote>
</li>
<li><p>
For both the mentioned <tt>string</tt> function template and the specific non-template functions (such as <tt>u16string()</tt>)
the same <tt>Remarks</tt> element exists, that refers to character conversion:
</p>
<blockquote><p>
Conversion, if any, is performed as specified by 8.2 [path.cvt].
</p></blockquote>
</li>
</ol>
<p>
The first quote excludes arbitrary types such as <tt>signed char</tt> or <tt>float</tt> as feasible template arguments.
The second quote makes clear that both the function template and the non-template functions do normatively refer to the same
wording in 8.2 [path.cvt].
<p/>
Based on this interpretation of the issue discussion I recommend resolving it as NAD.
<p/>
In addition to that recommendation I recommend to rename the current usage of the symbol <tt>charT</tt> in this technical
specification, because 5 [fs.req] assigns a very special meaning to the constraints on <tt>charT</tt> types that does not
exist to this extend in the rest of the standard library. A similar approach is used in Clause 22, where a special symbol <tt>C</tt>
is used for constrained character types (C++11 §22.3.1.1.1 [locale.category]):
</p>
<blockquote><p>
A template formal parameter with name <tt>C</tt> represents the set of types containing <tt>char</tt>, <tt>wchar_t</tt>,
and any other implementation-defined character types that satisfy the requirements for a character on which any of the