Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

bfast patch for fseek on large files

View gist:809634
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
diff --git a/bfast/RGIndex.c b/bfast/RGIndex.c
index 3e8f57a..cc5e426 100644
--- a/bfast/RGIndex.c
+++ b/bfast/RGIndex.c
@@ -1356,8 +1356,10 @@ void RGIndexMergeHelperFromDiskContig_8(RGIndex *index,
}
/* Move to beginning of the files */
- fseek(tmpLowerFP, 0 , SEEK_SET);
- fseek(tmpUpperFP, 0 , SEEK_SET);
+ fclose(tmpLowerFP);
+ fclose(tmpUpperFP);
+ tmpLowerFP = fopen(tmpLowerFileName, "rb");
+ tmpUpperFP = fopen(tmpUpperFileName, "rb");
/* Merge tmp files back into index */
/* Get first contig/pos */
@@ -1496,8 +1498,10 @@ void RGIndexMergeHelperFromDiskContig_32(RGIndex *index,
}
/* Move to beginning of the files */
- fseek(tmpLowerFP, 0 , SEEK_SET);
- fseek(tmpUpperFP, 0 , SEEK_SET);
+ fclose(tmpLowerFP);
+ fclose(tmpUpperFP);
+ tmpLowerFP = fopen(tmpLowerFileName, "rb");
+ tmpUpperFP = fopen(tmpUpperFileName, "rb");
/* Merge tmp files back into index */
/* Get first contig/pos */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.