Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FortranFiles.jl Changelog

Version 0.6.2-DEV
-------------

- ![INFO][badge-info] `seekstart` is used instead of `rewind` (which will be deprecated in future version).

Version 0.6.1
-------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ i, strings, zmatrix = read(f, Int32, (FString{20},10), (ComplexF64,10,10))
read(f)

# go back to the beginning of the file
rewind(f)
seekstart(f)
```

Example usage for writing files:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To test for EOF, use the standard Julia `eof` function.

The following functions are provided to emulate certain Fortran I/O statements:
```@docs
rewind
seekstart
```


Expand Down
2 changes: 1 addition & 1 deletion src/FortranFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ __precompile__()

module FortranFiles

export FortranFile, rewind
export FortranFile
export RECMRK4B, RECMRK8B
export FString, trimstring, trimlen, trim
export FortranFilesError
Expand Down
4 changes: 2 additions & 2 deletions src/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ end


"Re-position a `FortranFile` at its beginning."
rewind(f::FortranFile) = seek(f.io, 0)

Base.seekstart(f::FortranFile) = seekstart(f.io)
@deprecate rewind seekstart

Base.close(f::FortranFile) = close(f.io)

Expand Down
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,13 @@ Sys.islinux() && @testset "Testing records with $(rectest.desc), $(botest.name)
rewind(infile)
data2 = freaddata(infile)
@test data == data2
seekstart(infile)
data2 = freaddata(infile)
@test data == data2
end

@time @testset "Reading data with skipping" begin
rewind(infile)
seekstart(infile)
skipdata(infile)
close(infile)
end
Expand Down
Loading