File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -414,12 +414,19 @@ attribute the object was created with, and then is made relative to C<$base>.
414
414
415
415
Defined as:
416
416
417
- method parent(IO::Path:D: --> IO::Path)
418
-
419
- Removes the last portion of the path and returns the result as a new C < IO::Path > .
420
-
421
- my $io = IO::Path.new( "/etc/passwd" );
422
- say $io.parent; # OUTPUT: «"/etc".IO»
417
+ method parent(IO::Path:D: --> IO::Path:D)
418
+
419
+ Returns the parent path of the invocant. Note that no file system access
420
+ is made, so the returned parent parent is physical and not the logical parent of
421
+ symlinked directories.
422
+
423
+ '/etc/foo'.IO.parent.say; # OUTPUT: «"/etc".IO»
424
+ '/etc/..' .IO.parent.say; # OUTPUT: «"/etc".IO»
425
+ '/etc/../'.IO.parent.say; # OUTPUT: «"/etc".IO»
426
+ './' .IO.parent.say; # OUTPUT: «"..".IO»
427
+ 'foo' .IO.parent.say; # OUTPUT: «".".IO»
428
+ '/' .IO.parent.say; # OUTPUT: «"/".IO»
429
+ IO::Path::Win32.new('C:/').parent.say; # OUTPUT: «"C:/".IO»
423
430
424
431
= head2 method resolve
425
432
You can’t perform that action at this time.
0 commit comments