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

Stdlib: Support size in FileRead #3709

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Conversation

Shaikh-Ubaid
Copy link
Member

Fixes the following:

% cat file_19.f90 
program file_19
    implicit none

    character(len=25) :: buffer
    integer :: chunk, iostat

    open(11, file="file_19_data.txt")
    read(11, '(a)', iostat=iostat, size=chunk, advance='no') buffer

    print *, buffer
    if (buffer /= " Hi this is 1st line!") error stop

    print *, chunk
    if (chunk /= 21) error stop

end program
% cat file_19_data.txt 
 Hi this is 1st line!
% gfortran file_19.f90 
% ./a.out 
  Hi this is 1st line!    
          21
% lfortran_in_main file_19.f90 
 Hi this is 1st line!
1
ERROR STOP
% lfortran file_19.f90       
 Hi this is 1st line!
21

@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as ready for review March 25, 2024 22:05
Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, thanks!

@certik certik merged commit a0f2308 into lfortran:main Mar 25, 2024
21 checks passed
@Shaikh-Ubaid Shaikh-Ubaid deleted the fix_read branch March 26, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants