Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BDIO.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alberto Ramos
BDIO.jl
Commits
f632e103
Commit
f632e103
authored
4 years ago
by
Alberto Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add routine to read a nul-terminated string
parent
51191c7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
src/BDIOmethods.jl
src/BDIOmethods.jl
+26
-0
No files found.
src/BDIOmethods.jl
View file @
f632e103
...
@@ -316,6 +316,32 @@ function BDIO_read(fb::BDIOstream, vdata::Vector, n::Int64 = 0)
...
@@ -316,6 +316,32 @@ function BDIO_read(fb::BDIOstream, vdata::Vector, n::Int64 = 0)
end
end
"""
BDIO_read_str(fb::BDIOstream)
Read a nul-terminated string from BDIO file.
## Arguments
- `fb`: A BDIOstream type. It must be associated with a file.
## Examples
```julia-repl
julia> # Real 1000 floats from the first record of file `randoms.bdio`
julia> fb = BDIO_open("
randoms
.
bdio
", "
r
")
julia> BDIO_seek!(fb)
julia> str = BDIO_read_str(fb)
```
"""
function
BDIO_read_str
(
fb
::
BDIOstream
)
rpos
::
Int64
=
max
(
fb
.
records
[
fb
.
ipt
]
.
rpos
,
fb
.
rwpos
)
seek
(
fb
.
io
,
rpos
)
str
::
String
=
readuntil
(
fb
.
io
,
'\0'
)
fb
.
rwpos
=
position
(
fb
.
io
)
return
str
end
"""
"""
BDIO_get_len(fb::BDIOstream)
BDIO_get_len(fb::BDIOstream)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment