-
Notifications
You must be signed in to change notification settings - Fork 173
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
Proposal: File handling procedures (goto, touch, grep) #851
Comments
My first impression is that touch and grep are linux-user-oriented, Windows users might not be familiar with their syntax. Such functionality should be OS agnostic (as best as possible). Regarding touch I think that Fortran's native Regarding For |
@jalvesz, thanks for the great feedback.:) Yeah, these are very linux/unix-based ideas. Does that mean they shouldn't be in fpm, or just change the naming convention and their syntax? Regarding Regarding My own personal implementation of |
I guess You are right,
Yes, in which case you could load the file into a single large string and from there apply all sorts of extractions character(:), allocatable :: file_str_handle
open( newunit = u , file=name, access='stream', action="read", iostat=err )
inquire(unit=u, size=file_sze)
allocate(character(file_sze) :: file_str_handle)
read(u) file_str_handle
close(u)
...
!> Do stuff on "file_str_handle" This is limited to files that can be fully loaded in the RAM. Larger files might need something like this https://fortran-lang.discourse.group/t/memory-mapped-files-in-fortran/7178/20 to be available ... or loading by chunks reading line-by-line. |
Motivation
I have had a look through the
stdlib_io
module and cannot find the following procedures implemented. But I could be wrong.Should stdlib contain some more
io
features present in languages such as bash? I quite often find the need to use the following and have, so far, resorted to using my own implementations:I often find the need for procedures to quickly navigate and check for strong occurrences within files to be able to best take advantage external files.
Prior Art
sed -n '10p' filename
.Additional Information
No response
The text was updated successfully, but these errors were encountered: