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

Derived type for file connections #398

Closed
Beliavsky opened this issue Apr 25, 2021 · 2 comments
Closed

Derived type for file connections #398

Beliavsky opened this issue Apr 25, 2021 · 2 comments

Comments

@Beliavsky
Copy link

Beliavsky commented Apr 25, 2021

I don't think Fortran's use of integer unit numbers for file connections is ideal. This cannot be changed, but I suggest that stdlib have a file derived type to encapsulate the unit number and other properties of a file. It would have attributes found in the OPEN statement and could look like

type, public :: file
   character (len=1000)  :: name
   integer               :: unit
   character (len=100)   :: action
   character (len=100)   :: status
   character (len=100)   :: access
   character (len=100)   :: form
end type file

Users could declare type(file) variables and pass them, instead of unit numbers or file names, to subroutines.

@milancurcic
Copy link
Member

See #14

@Beliavsky
Copy link
Author

Thanks @milancurcic -- closing this issue so that further discussion occurs there.

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

No branches or pull requests

2 participants