@@ -23,8 +23,8 @@ DRAFT: Synopsis 32: Setting Library - IO
23
23
24
24
Created: 19 Feb 2009 extracted from S29-functions.pod; added stuff from S16-IO later
25
25
26
- Last Modified: 28 March 2013
27
- Version: 17
26
+ Last Modified: 17 April 2013
27
+ Version: 18
28
28
29
29
The document is a draft.
30
30
@@ -43,8 +43,7 @@ methods on file handles.
43
43
File handles are of type C<IO::Handle>, and can be created with C<&open>.
44
44
Paths are generally passed as strings or C<IO::Path> objects.
45
45
46
- C<&dir> returns C<IO::File> and C<IO::Dir> objects, which are
47
- subclasses of C<IO::Path>.
46
+ C<&dir> returns C<IO::Path> objects.
48
47
49
48
50
49
default handle
@@ -97,9 +96,9 @@ and the parent directory are excluded, which can be controlled with the
97
96
C<$test> named parameter. Only items that smart-match against this test are
98
97
returned.
99
98
100
- The return value is a list of C<IO::File> and C<IO::Dir> objects. Because of
101
- this, you may want use the C<basename> method on the results to get the just
102
- the file name, without its full path.
99
+ The return value is a list of C<IO::Path> objects. Because of this, you may
100
+ want use the C<basename> method on the results to get the just the file name,
101
+ without its full path.
103
102
104
103
=item note
105
104
@@ -353,11 +352,11 @@ Closes the handle. Fails on error.
353
352
354
353
Provides ways to inspect a file or path without opening it.
355
354
356
- If you apply that role to a class, that class must provide a C<path>
357
- method which C<IO::FileTests>' method will call to obtain the path to
358
- test. This C< path> method must return a C<Str:D>.
355
+ If you apply that role to a class, that class must provide a C<Str> method
356
+ which returns the full path. C<IO::FileTests> will call this method
357
+ to obtain the path to test. Stringification must return C<Str:D> here .
359
358
360
- The methods are typically only one letter long (for now; perl 5 tradition
359
+ The methods are typically only one letter long (for now; Perl 5 tradition
361
360
strikes) and are summarized in the following table:
362
361
363
362
M Test performed
@@ -391,7 +390,7 @@ TODO: methods created, accessed, modified
391
390
392
391
=head2 IO::Path
393
392
394
- class IO::Path is Cool does IO::FileTest { }
393
+ class IO::Path is Cool does IO::FileTestable { }
395
394
396
395
Holds a path of a file or directory. The path is generally divided
397
396
into three parts, the I<volume>, I<directory> and I<base name>.
@@ -440,9 +439,9 @@ current and the parent directory are excluded, which can be controlled with
440
439
the C<$test> named parameter. Only items that smart-match against this test
441
440
are returned.
442
441
443
- The return value is a list of C<IO::File> and C<IO::Dir> objects. Because of
444
- this, you may want use the C<basename> method on the results to get the just
445
- the file name, without its full path.
442
+ The return value is a list of C<IO::Path> objects. Because of this, you may
443
+ want use the C<basename> method on the results to get the just the file name,
444
+ without its full path.
446
445
447
446
=item is-relative
448
447
@@ -474,20 +473,6 @@ already relative are returned unchanged.
474
473
475
474
=back
476
475
477
- =head2 IO::File
478
-
479
- class IO::File is IO::Path { ... }
480
-
481
- Represents a path that is known to be a plain file (not a directory), at
482
- least at the time when the object was created.
483
-
484
- =head2 IO::Dir
485
-
486
- class IO::Dir is IO::Path { ... }
487
-
488
- Represents a path that is known to be a directory, at
489
- least at the time when the object was created.
490
-
491
476
=head1 Here Be Dragons
492
477
493
478
Everything below this point hasn't been reviewed properly
@@ -1019,7 +1004,7 @@ passed in. Here are some example mappings:
1019
1004
1020
1005
URI type IO type
1021
1006
======== =======
1022
- file: IO::File or IO::Directory
1007
+ file: IO::Path
1023
1008
ftp: IO::Socket::INET (data channel)
1024
1009
http: IO::Socket::INET
1025
1010
0 commit comments