develooper Front page | perl.perl5.porters | Postings from January 2020

open(IO, '+>:unix', "/path/to/file") doesn't leak

Thread Previous
Eric Wong
January 24, 2020 11:28
open(IO, '+>:unix', "/path/to/file") doesn't leak
Message ID:
I also found a case where it doesn't leak with just open:

for (0..50) {
	# having a path arg doesn't leak
	open(my $fh, '+>:unix', '/tmp/foo') or die "open: $!";

	# but calling binmode :unix does trigger the leak,
	# uncomment to reproduce the leak:
	# binmode $fh, ':unix';
# shows the files opened above, if any
system "lsof -p $$";

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About