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

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

Thread Previous
From:
Eric Wong
Date:
January 24, 2020 11:28
Subject:
open(IO, '+>:unix', "/path/to/file") doesn't leak
Message ID:
20200124112822.GA29337@dcvr
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About