Commit dc3344d5 authored by Alberto Ramos's avatar Alberto Ramos

Added BDIO_close method

parent 02e9d648
......@@ -17,10 +17,11 @@ BDIO_set_user
BDIO_set_host
```
### Openning `BDIO` files
### Openning/closing `BDIO` files
```@docs
BDIO_open
BDIO_close!
```
## Writing data to `BDIO` files
......
......@@ -21,6 +21,6 @@ export BDIO_BIN_GENERIC, BDIO_ASC_EXEC, BDIO_BIN_INT32BE,
# Methods
export BDIOstream, BDIO_open, BDIO_start_record!, BDIO_write_hash!,
BDIO_write!, BDIO_seek!, BDIO_get_len, BDIO_get_fmt,
BDIO_get_uinfo, BDIO_read, BDIO_set_user, BDIO_set_host
BDIO_get_uinfo, BDIO_read, BDIO_set_user, BDIO_set_host, BDIO_close!
end # module
......@@ -79,6 +79,22 @@ function BDIO_open(fname::String, mode::String, protocol_info::String="")
return fb
end
"""
Closes the file associated with fb and clears the record database
## Arguments
- `fb`: A BDIOstream type. It must be associated with a file.
## Examples
```julia-repl
julia> fb = BDIO_open("new_file.bdio", "w", "Test file")
julia> BDIO_close(fb)
"""
function BDIO_close!(fb)
close(fb.io)
fb.records = similar(Array{record,1}, 0)
end
"""
Start a new BDIO record at the end of the file. Currently the supported formats are
- `BDIO_BIN_GENERIC`: Generic binary data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment