HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- fseek with over 2G file problem
Operating System - HP-UX
1826215
Members
2785
Online
109691
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2005 06:51 PM
04-14-2005 06:51 PM
Does anyone has the experience about fseek support over 2G file? I have try to use fseeko() to seek file over 2G, but it get the wrong bytes. Anyone knows fseek or fseeko support file over 2G ? Thanks .
Hero
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2005 07:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2005 02:30 AM
04-15-2005 02:30 AM
Re: fseek with over 2G file problem
See the following white paper for full discussion.
HP-UX Large Files White Paper Version 1.4
http://docs.hp.com/en/940/lgfiles4.pdf
To confuse things further ...
Q: Having studied the white paper on Large file support with HP-UX, I am confused by the discussion of the preprocessor macros _LARGEFILE_SOURCE, _LARGEFILE64_SOURCE and _FILE_OFFSET_BITS. Can you summarize their significance for me please?
Use _FILE_OFFSET_BITS=64 if you have a POSIX compliant app that does not use ftell or fseek, and you want to compile for large file access. This has the effect of mapping all the regular calls like 'open' to 'open64' etc. Use _FILE_OFFSET_BITS=64 and _LARGEFILE64_SOURCE if you have a POSIX compliant app that does use ftell and/or fseek. This will result in the calls to ftell/fseek being transformed into ftello64/fseeko64 which are HP extensions allowing these functions to use a file offset beyond the POSIX mandated long data type. _LARGEFILE_SOURCE would map ftell/fseek to ftello/fseeko respectively, the 32-bit versions of these function calls. If you wish to mix 32 and 64 bit calls in the same binary, e.g reading from a 32-bit file and writing to a 64-bit one, you should use (e.g.) lseek and lseek64 explicitly and turn on the _LARGEFILE64_SOURCE macro when compiling.
HP-UX Large Files White Paper Version 1.4
http://docs.hp.com/en/940/lgfiles4.pdf
To confuse things further ...
Q: Having studied the white paper on Large file support with HP-UX, I am confused by the discussion of the preprocessor macros _LARGEFILE_SOURCE, _LARGEFILE64_SOURCE and _FILE_OFFSET_BITS. Can you summarize their significance for me please?
Use _FILE_OFFSET_BITS=64 if you have a POSIX compliant app that does not use ftell or fseek, and you want to compile for large file access. This has the effect of mapping all the regular calls like 'open' to 'open64' etc. Use _FILE_OFFSET_BITS=64 and _LARGEFILE64_SOURCE if you have a POSIX compliant app that does use ftell and/or fseek. This will result in the calls to ftell/fseek being transformed into ftello64/fseeko64 which are HP extensions allowing these functions to use a file offset beyond the POSIX mandated long data type. _LARGEFILE_SOURCE would map ftell/fseek to ftello/fseeko respectively, the 32-bit versions of these function calls. If you wish to mix 32 and 64 bit calls in the same binary, e.g reading from a 32-bit file and writing to a 64-bit one, you should use (e.g.) lseek and lseek64 explicitly and turn on the _LARGEFILE64_SOURCE macro when compiling.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP