Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a new index format for files > 2GB. #477

Merged
merged 18 commits into from
Jan 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
starting to deal with large file index
edwardhartnett committed Jan 29, 2024
commit b3d264017a6be28651c430a830eca35b73a3e700
5 changes: 5 additions & 0 deletions src/g2cindex.c
Original file line number Diff line number Diff line change
@@ -354,6 +354,7 @@ g2c_write_index(int g2cid, int mode, const char *index_file)
char my_path[G2C_INDEX_BASENAME_LEN + 1];
G2C_MESSAGE_INFO_T *msg;
int total_index_size = 0; /* Does not include size of header records. */
int large_file_index = 0; /* True if indexed file may be > 2 GB. */
int reclen;
int ret = G2C_NOERROR;

@@ -377,6 +378,10 @@ g2c_write_index(int g2cid, int mode, const char *index_file)
}
}

/* If LARGE_INDEX_FILE, check if file exists. */
if (mode & G2C_LARGE_FILE_INDEX)
large_file_index++;

/* Create the index file. */
if (!(f = fopen(index_file, "wb+")))
return G2C_EFILE;