diff --git a/CHANGELOG.md b/CHANGELOG.md index 650f099..3f1ae19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ------------- diff --git a/README.md b/README.md index 681dff6..b43847f 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/docs/src/files.md b/docs/src/files.md index d8bbbb9..7450932 100644 --- a/docs/src/files.md +++ b/docs/src/files.md @@ -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 ``` diff --git a/src/FortranFiles.jl b/src/FortranFiles.jl index f001a2b..4f24cfc 100644 --- a/src/FortranFiles.jl +++ b/src/FortranFiles.jl @@ -2,7 +2,7 @@ __precompile__() module FortranFiles - export FortranFile, rewind + export FortranFile export RECMRK4B, RECMRK8B export FString, trimstring, trimlen, trim export FortranFilesError diff --git a/src/file.jl b/src/file.jl index 4098e22..2a7cf40 100644 --- a/src/file.jl +++ b/src/file.jl @@ -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) diff --git a/test/runtests.jl b/test/runtests.jl index 90017d9..4aa8f7e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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