Skip to content

Commit 9a63dc4

Browse files
committed
[io grant] Document IO::Path.cleanup
1 parent 5ced9b1 commit 9a63dc4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/Type/IO/Path.pod6

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ paths and is also slower, since it has to do more work. Use
143143
L«C<.add>|/routine/add» if your code does not need to guarantee the added
144144
path is in fact a child path.
145145
146+
=head2 method cleanup
147+
148+
Defined as:
149+
150+
method cleanup(IO::Path:D: --> IO::Path:D)
151+
152+
Returns a new path that is a canonical representation of the invocant path,
153+
cleaning up any extraneous path parts:
154+
155+
"foo/./././..////bar".IO.cleanup.say; # OUTPUT: «"foo/../bar".IO␤»
156+
IO::Path::Win32.new("foo/./././..////bar")
157+
.cleanup.say; "foo\..\bar".IO; # OUTPUT: «"foo\\..\\bar".IO␤»
158+
159+
Note that no file system access is made. See also
160+
L«C<resolve>|/routine/resolve».
161+
146162
=head2 method extension
147163
148164
Defined as:

0 commit comments

Comments
 (0)