Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how to truncate huge ( >2G ) files? Posted by bence on 12 Sept 2004 at 7:21 AM
If I try to seek in a file that is bigger than 2 gigs it has an I/O error (131), wich is the pointing before file start or something :)
After that the truncate will truncate in position 0 (or won't truncate, if I/O check is active)
How can I overload the seek() and the truncate() procedure to handle int64 size files? (longint isn't working)
Report
Re: how to truncate huge ( >2G ) files? Posted by zibadian on 12 Sept 2004 at 7:52 AM
: If I try to seek in a file that is bigger than 2 gigs it has an I/O error (131), wich is the pointing before file start or something :)
: After that the truncate will truncate in position 0 (or won't truncate, if I/O check is active)
: How can I overload the seek() and the truncate() procedure to handle int64 size files? (longint isn't working)
:
You cannot easily overload those functions, because they use compiler magic to be handled by Delphi. But you can use the windows API file functions (CreateFile(), ReadFile(), WriteFile(), etc) for this. The windows help files have more info on those functions.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.