Skip to content

Conversation

jmarshall
Copy link
Member

Also fixes unchecked-write-error bugs in index writing.

The routines in zfio.c are now unused so can be removed. As a happy byproduct, HTSlib no longer uses fseeko(), so no heroics are needed for platforms where that function is not available.

Check the return values from cram_index_build_multiref() and from
writing to the index file.

The (never publicly exposed) zfio.c routines are now unused in HTSlib
so can be removed.  Fixes part of samtools#552.
@jmarshall jmarshall mentioned this pull request Jun 6, 2017
@jkbonfield jkbonfield merged commit a0fe63f into samtools:develop Jun 6, 2017
@jkbonfield
Copy link
Contributor

Thanks John.

@jmarshall
Copy link
Member Author

If I'd realised there would be as little to change as that, I'd have got around to it years ago 😄

@jmarshall jmarshall deleted the rm-zfio branch June 6, 2017 13:12
@jkbonfield
Copy link
Contributor

Quite. "Getting around to it" is always a tricky thing. I decided to keep going with it noticing vlen.h next to the removed zfio.h so culled the reason for that existing too. :-)

The io_lib legacy lives on still in places, but it's all an incremental improvement.

@jmarshall
Copy link
Member Author

Yep… nice.

My plan for that corner was to replace cram_io.c's open_path_mfile() and find_path() calls with HTSlib's wider facilities that by now have (almost?) expanded to do what's actually needed for reference path handling. At that point, mFILE.[ch], open_trace_file.[ch], and vlen.[ch] all evaporate.

@jkbonfield
Copy link
Contributor

There is still #417 which is on my radar to check out. This may well provide most of the functionality needed as it's been written with the same need in mind - faking up file IO from a memory buffer.

Although to be frank the reference handling code was rather "organic" during development and is a rats nest in need of a complete rewrite. It would be useful outside of CRAM too, for things like mpileup and tview. That's a bit of a longer project needing a rainy month.

@jmarshall
Copy link
Member Author

hFILE fixed buffers, introduced for data: URLs but over the top just for those, and var-args hopen were designed with that memory buffer PR in mind. I've written up my past plans for such functionality over on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants