Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filehandle not flushed at program exit #2214

Closed
p6rt opened this issue Oct 19, 2010 · 6 comments
Closed

Filehandle not flushed at program exit #2214

p6rt opened this issue Oct 19, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Oct 19, 2010

Migrated from rt.perl.org#78454 (status was 'resolved')

Searchable as RT78454$

@p6rt
Copy link
Author

p6rt commented Oct 19, 2010

From @colomon

my $file = open "test.txt", :w;

for 1..1000 {
  $file.say​: sprintf("This is a test
  %7d", $_);
}

# end of text.txt after executing this​:

This is a test 980
This is a test 981
This is a test 982
This is a test 983
This is a test 984
This is a test 985
This is a test 986
This is a test 987
This is a test 988
This is a test # file ends before \n on this line

This happens with

  This is Rakudo Perl 6, version 2010.09-60-gd497078 built on parrot
2.9.0 r49583

on the OS X, and

  This is Rakudo Perl 6, version 2010.09-53-gd357695 built on parrot
2.8.0 r49541

on Linux.

--
Solomon Foster​: colomon@​gmail.com
HarmonyWare, Inc​: http://www.harmonyware.com

@p6rt
Copy link
Author

p6rt commented Feb 24, 2014

From @coke

On Tue Oct 19 13​:47​:36 2010, Solomon wrote​:

my $file = open "test.txt", :w;

for 1..1000 {
$file.say​: sprintf("This is a test
%7d", $_);
}

# end of text.txt after executing this​:

This is a test 980
This is a test 981
This is a test 982
This is a test 983
This is a test 984
This is a test 985
This is a test 986
This is a test 987
This is a test 988
This is a test # file ends before \n on this line

This happens with

This is Rakudo Perl 6, version 2010\.09\-60\-gd497078 built on parrot

2.9.0 r49583

on the OS X, and

This is Rakudo Perl 6, version 2010\.09\-53\-gd357695 built on parrot

2.8.0 r49541

on Linux.

I cannot duplicate this error now. Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 24, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 24, 2014

From dvj@dagur.com

There is a related test in roast/ S32-io/io-handle.t that tests that IO
flushes when it goes out of scope.

rakudo-parrot still doesn't do that​:
10​:57 <dagurval> r​: "asdf".IO.open(​:w).print("24"); say slurp "asdf";
10​:57 <camelia> rakudo-jvm 299d70, rakudo-moar 299d70​: OUTPUT«24␤»
10​:57 <camelia> ..rakudo-parrot 299d70​: OUTPUT«␤»

On Mon, Feb 24, 2014 at 8​:47 AM, Will Coleda via RT <
perl6-bugs-followup@​perl.org> wrote​:

On Tue Oct 19 13​:47​:36 2010, Solomon wrote​:

my $file = open "test.txt", :w;

for 1..1000 {
$file.say​: sprintf("This is a test
%7d", $_);
}

# end of text.txt after executing this​:

This is a test 980
This is a test 981
This is a test 982
This is a test 983
This is a test 984
This is a test 985
This is a test 986
This is a test 987
This is a test 988
This is a test # file ends before \n on this line

This happens with

This is Rakudo Perl 6, version 2010\.09\-60\-gd497078 built on parrot

2.9.0 r49583

on the OS X, and

This is Rakudo Perl 6, version 2010\.09\-53\-gd357695 built on parrot

2.8.0 r49541

on Linux.

I cannot duplicate this error now. Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 13, 2015

From @jdv

Test already exists in S32-io/io-handle.t but comment pointing here added.

@p6rt
Copy link
Author

p6rt commented May 13, 2015

@jdv - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant