Skip to content

it seemed that length function is wrong #2

Description

@YuBeomGon

in example.cpp,
total means that total byte number in file.
available means the left byte number in file.
is it right??

but in below code,
total and available have same value,

int Length(long long *total, long long *available)
{
	if (!m_file)
		return -1;
	const off_t pos = ftell(m_file);
	fseek(m_file, 0, SEEK_END);
	if (total)
		*total = ftell(m_file);
	if (available)
		*available = ftell(m_file);
	fseek(m_file, pos, SEEK_SET);
	return 0;
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions