Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6228603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:25:09+00:00 2026-05-24T09:25:09+00:00

in c fseek,fopen this all function works for long int means only handle file

  • 0

in c fseek,fopen this all function works for long int means only handle file of 2 gb.
now how can i open file whose size is more than 2 GB?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:25:09+00:00Added an answer on May 24, 2026 at 9:25 am

    As the commenters have already explained, whether you can open a file of more than 2GB depends on the OS and C library, not on the compiler on sizeof(long). If your OS supports such files, you should be able to fopen them, although you may have to set a flag (#define _FILE_OFFSET_BITS 64 for Linux).

    Then, fseek indeed cannot seek to positions farther away than LONG_MAX in a single call. You can either call fseek several times in a loop, which can be cumbersome, or check if your platform has fseeko which takes an offset argument of type off_t. That type should be big enough to capture the size of any (regular) file on your system if you set the right options. fseeko is available on newer Linux and all POSIX-2001-compliant OSs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP's fopen lets you fopen() http locations as file streams. But you can't fseek()
#include <stdio.h> #include <stdlib.h> int main() { FILE *fp = fopen(lr.txt, r); fseek(fp, 0L,
Basically the problem comes down to this: I load a file, write all the
I used this code to read file. But fread function always return 0. What
I am trying to read all content from a text file. Here is the
So here's the problem, I'm reading a level file for my game, works fine
I'm performing I/O to a single file from multiple threads. Access to this shared
I have problem running and debugging this piece of code: bool readSectionHeaders(char* path, int
I am trying to extract the mp3 header from a file. This is different
I have rjecnik.txt file that looks like this mate sime, jure stipica gujo, prvi

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.