Skip to content

Commit 12ca2af

Browse files
authored
Merge pull request #2040 from chsanch/term-norm
Change "file handle" to "filehandle"
2 parents 491f703 + c4a2beb commit 12ca2af

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

doc/Language/5to6-nutshell.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ foo(3); # /language/functions#index-entry-dispatch_callsame
290290
today, and refactor this section to list them (with translations).
291291
292292
In Perl 5, the C<*> sigil referred to the GLOB structure that Perl uses to
293-
store non-lexical variables, file handles, subs, and formats.
293+
store non-lexical variables, filehandles, subs, and formats.
294294
295295
(This should not be confused with the Perl 5 built-in C<glob()> function,
296296
which reads filenames from a directory).

doc/Language/glossary.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ Too complicated to apply a meta-op to. See L<operator|#Operator>.
311311
312312
=head1 Handle
313313
314-
A handle is a data structure used to store information about some input/output operation such as file or socket reading or writing. Perl 6 uses L<IO::Handle> as a base class for file handles, and L<IO::Socket> for sockets.
314+
A handle is a data structure used to store information about some input/output operation such as file or socket reading or writing. Perl 6 uses L<IO::Handle> as a base class for filehandles, and L<IO::Socket> for sockets.
315315
316316
=head1 Huffmanize
317317
@@ -938,14 +938,14 @@ my $lines = $fh.lines;
938938
close $fh;
939939
say $lines[0];
940940
941-
We open a L<file handle|/type/IO::Handle>, then assign return of
941+
We open a L<filehandle|/type/IO::Handle>, then assign return of
942942
L«C<.lines>|/type/IO::Handle#method_lines» to a L<Scalar> variable, so the
943943
returned L<Seq> does not get reified right away. We then
944-
L«C<close>|/routine/close» the file handle, and try to print an element from
944+
L«C<close>|/routine/close» the filehandle, and try to print an element from
945945
C<$lines>.
946946
947947
The bug in the code is by the time we reify the C<$lines> L<Seq> on the last
948-
line, we've I<already closed> the file handle. When the C<Seq's> iterator tries
948+
line, we've I<already closed> the filehandle. When the C<Seq's> iterator tries
949949
to generate the item we've requested, it results in the error about attempting
950950
to read from a closed handle. So, to fix the bug we can either assign to
951951
a C<@>-sigiled variable or call L«C<.elems>|/routine/elems» on C<$lines> before

doc/Language/io-guide.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
The vast majority of common IO work is done by the L<IO::Path> type. If you
1010
want to read from or write to a file in some form or shape, this is the class
11-
you want. It abstracts away the details of file handles (or "file descriptors")
11+
you want. It abstracts away the details of filehandles (or "file descriptors")
1212
and so you mostly don't even have to think about them.
1313
1414
Behind the scenes, L<IO::Path> works with L<IO::Handle>; a class which you
@@ -119,7 +119,7 @@ with a lot of files, as many systems have limits to how many files a program
119119
can have open at the same time. If you don't close your handles, eventually
120120
you'll reach that limit and the L«C<.open>|/routine/open» call will fail.
121121
Note that unlike some other languages, Perl 6 does not use reference counting,
122-
so the file handles B<are NOT closed> when the scope they're defined in is left.
122+
so the filehandles B<are NOT closed> when the scope they're defined in is left.
123123
They will be closed only when they're garbage collected and failing to close
124124
the handles may cause your program to reach the file limit I<before> the open
125125
handles get a chance to get garbage collected.
@@ -165,7 +165,7 @@ loading it entirely:
165165
Note that we did this by passing a limit argument to
166166
L«C<.words>|/type/IO::Path#method_words» instead of, say, using
167167
L<a list indexing operation|/language/operators#index-entry-array_indexing_operator-array_subscript_operator-array_indexing_operator>.
168-
The reason for that is there's still a file handle in use under the hood, and
168+
The reason for that is there's still a filehandle in use under the hood, and
169169
until you fully consume the returned L<Seq>, the handle will remain open.
170170
If nothing references the L<Seq>, eventually the handle will get closed, during
171171
a garbage collection run, but in large programs that work with a lot of files,
@@ -231,7 +231,7 @@ introduce security issues (e.g. null characters)!
231231
232232
The L«C<IO::Path>|/type/IO::Path» type is the workhorse of Perl 6 world. It
233233
caters to all the path manipulation needs as well as provides shortcut routines
234-
that let you avoid dealing with file handles. Use that instead of the
234+
that let you avoid dealing with filehandles. Use that instead of the
235235
L«C<$*SPEC>|/language/variables#Dynamic_variables» stuff.
236236
237237
Tip: you can join path parts with C</> and feed them to

doc/Language/io.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ my $fh = open "testfile", :r;
1919
my $contents = $fh.slurp-rest;
2020
$fh.close;
2121
22-
Here we explicitly close the file handle using the C<close> method on the
22+
Here we explicitly close the filehandle using the C<close> method on the
2323
C<IO::Handle> object. This is a very traditional way of reading the
2424
contents of a file. However, the same can be done more easily and clearly
2525
like so:
@@ -86,7 +86,7 @@ my $fh = open "testfile", :w;
8686
$fh.printf("formatted data %04d\n", 42);
8787
$fh.close;
8888
89-
To append to a file, specify the C<:a> option when opening the file handle
89+
To append to a file, specify the C<:a> option when opening the filehandle
9090
explicitly,
9191
9292
=for code

doc/Language/ipc.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ a variable, even anonymous one, to prevent the sinking:
4444
4545
$ = run '/bin/false'; # does not sink the Proc and so does not throw
4646
47-
You can tell the C<Proc> object to capture output as a file handle by passing
47+
You can tell the C<Proc> object to capture output as a filehandle by passing
4848
the C<:out> and C<:err> flags. You may also pass input via the C<:in> flag.
4949
5050
my $echo = run 'echo', 'Hello, world', :out;

doc/Language/traps.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ sub explicitly-return-ret () {
10951095
=head2 Closing Open File Handles and Pipes
10961096
10971097
Unlike some other languages, Perl 6 does not use reference counting,
1098-
and so B<the file handles are NOT closed when they go out of scope>. You
1098+
and so B<the filehandles are NOT closed when they go out of scope>. You
10991099
have to explicitly close them either by using L<close> routine or using the
11001100
C<:close> argument several of L<IO::Handle's|/type/IO::Handle> methods accept.
11011101
See L«C<IO::Handle.close>|/type/IO::Handle#routine_close» for details.

doc/Language/unicode.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ One case where we don't default to this, is for the names of files. This is beca
4444
the names of files must be accessed exactly as the bytes are written on the disk.
4545
4646
To avoid normalization you can use a special encoding format called L<UTF8-C8|#UTF8-C8>.
47-
Using this encoding with any file handle will allow you to read the exact bytes as they are
47+
Using this encoding with any filehandle will allow you to read the exact bytes as they are
4848
on disk, without normalization. They may look funny when printed out, if you print it out using a
4949
UTF8 handle. If you print it out to a handle where the output encoding is UTF8-C8,
5050
then it will render as you would normally expect, and be a byte for byte exact

doc/Type/IO.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Defined as:
179179
multi sub print(Junction:D --> True)
180180
181181
Prints the given text on standard output (the
182-
L«C<$*OUT>|/language/variables#index-entry-%24%2AOUT» file handle), coercing non-L<Str> objects
182+
L«C<$*OUT>|/language/variables#index-entry-%24%2AOUT» filehandle), coercing non-L<Str> objects
183183
to L<Str> by calling L«C<.Str> method|/routine/Str». L<Junction> arguments
184184
L<autothread|/language/glossary#index-entry-Autothreading> and the order of printed strings
185185
is not guaranteed.

doc/Type/IO/Handle.pod6

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ an explicit C<close> is I<recommended> on handles opened for reading as well, so
111111
that your program does not open too many files at the same time, triggering
112112
exceptions on further C<open> calls.
113113
114-
B<Note (Rakudo versions 2017.09 and after):> Open file handles are
114+
B<Note (Rakudo versions 2017.09 and after):> Open filehandles are
115115
automatically closed on program exit, but it is still highly
116116
recommended that you C<close> opened handles explicitly.
117117
@@ -213,7 +213,7 @@ Defined as:
213213
submethod DESTROY(IO::Handle:D:)
214214
215215
Closes the filehandle, unless its L<native-descriptor> is C<2> or lower. This
216-
ensures the standard file handles do not get inadvertently closed.
216+
ensures the standard filehandles do not get inadvertently closed.
217217
218218
Note that garbage collection is not guaranteed to
219219
happen, so you must NOT rely on C<DESTROY> for closing the handles you
@@ -269,7 +269,7 @@ Defined as:
269269
multi method encoding(IO::Handle:D: $enc --> Str:D)
270270
271271
Returns a L<Str> representing the encoding currently used by
272-
the handle, defaulting to C<"utf8">. C<Nil> indicates the file handle is
272+
the handle, defaulting to C<"utf8">. C<Nil> indicates the filehandle is
273273
currently in binary mode. Specifying an optional positional C<$enc> argument
274274
switches the encoding used by the handle; specify C<Nil> as encoding to put the
275275
handle into binary mode.
@@ -766,9 +766,9 @@ Defined as:
766766
method close(IO::Handle:D: --> Bool:D)
767767
multi sub close(IO::Handle $fh)
768768
769-
Closes an open file handle. It's not an error to call C<close> on an
769+
Closes an open filehandle. It's not an error to call C<close> on an
770770
already-closed filehandle. Returns C<True> on success. If you close
771-
one of the standard file handles (by default: C<$*IN>, C<$*OUT>, or C<$*ERR>),
771+
one of the standard filehandles (by default: C<$*IN>, C<$*OUT>, or C<$*ERR>),
772772
that is any handle with L<native-descriptor> C<2> or lower, you won't be
773773
able to re-open such a handle.
774774
@@ -800,7 +800,7 @@ given "foo/bar".IO.open(:w) {
800800
=end code
801801
802802
B<Note:> unlike some other languages, Perl 6 does not use reference counting,
803-
and so B<the file handles are NOT closed when they go out of scope>. While
803+
and so B<the filehandles are NOT closed when they go out of scope>. While
804804
they I<will> get closed when garbage collected, garbage collection isn't
805805
guaranteed to get run. This means B<you must> use an explicit C<close> on
806806
handles opened for writing, to avoid data loss, and an explicit C<close>
@@ -811,7 +811,7 @@ C<open> calls.
811811
Note several methods allow for providing C<:close> argument, to close the handle
812812
after the operation invoked by the method completes. As a simpler alternative,
813813
the L<IO::Path> type provides many reading and writing methods that let you work
814-
with files without dealing with file handles directly.
814+
with files without dealing with filehandles directly.
815815
816816
=head2 method flush
817817

doc/Type/IO/Path.pod6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ L<Seq>.
763763
B<NOTE:> words are lazily read.
764764
The handle used under the hood is not closed until the returned L<Seq> is
765765
L<fully reified|/language/glossary#index-entry-Reify>, and this could lead
766-
to leaking open file handles. It is possible to avoid leaking open file handles
766+
to leaking open filehandles. It is possible to avoid leaking open filehandles
767767
using the L«C<$limit> argument|/type/IO::Handle#routine_words» to cut down
768768
the C<Seq> of words to be generated.
769769
@@ -789,7 +789,7 @@ L<Seq>.
789789
B<NOTE:> the lines are ready lazily and the handle used under the hood won't
790790
get closed until the returned L<Seq> is
791791
L<fully reified|/language/glossary#index-entry-Reify>, so ensure it is,
792-
or you'll be leaking open file handles. (TIP: use the
792+
or you'll be leaking open filehandles. (TIP: use the
793793
L«C<$limit> argument|/type/IO::Handle#routine_lines»)
794794
795795
=begin code

0 commit comments

Comments
 (0)