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 8160221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:10:03+00:00 2026-06-06T18:10:03+00:00

I get an I/O Error 1784 due to blockwrite in the following code which

  • 0

I get an I/O Error 1784 due to blockwrite in the following code
which overwrites 3 times a file.

I presume I/O Error 1784 means ERROR_INVALID_USER_BUFFER.

I don’t know why. The error appears sometimes, not at each run…

Could you help me ?

   procedure overwrite_files_3_times(iPath : string); 
    var
      numwritten : integer;
      iFileSize, iPosition : int64;
      InFile : File of byte;
      ipBufBlock : pTBUFFER;
      k : integer;

    begin
      if not FileExists(iPath) then
        exit;   


      FileMode := fmOpenRead or fmOpenWrite or fmShareDenyNone;      

      AssignFile(InFile, iPath);
      Reset(InFile);


      iFileSize := getfilesize2(iPath);  // retrieve the filesize
      iPosition := 0;



          // 3 overwrites
          for k:= 0 to 3-1 do
            begin
              Seek(InFile, 0);
              iPosition := 0;
              ///////////////////
              // on écrit
              while iPosition + sizeOf(TBuffer) < iFileSize do
                begin
                  BlockWrite(InFile,ipBufBlock^,sizeOf(TBuffer),numwritten);               
                  iPosition := iPosition + sizeOf(TBuffer);                                
                end;

              // the end
              if iPosition <= iFileSize -1 then
                begin
                 BlockWrite(InFile,ipBufBlock^,iFileSize-iPosition,numwritten);    //-->> generate I/O Error 1784       
                end;                                                                      
            end;


      ////////////////
      CloseFile(InFile);
end;
  • 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-06-06T18:10:04+00:00Added an answer on June 6, 2026 at 6:10 pm

    Assuming pTBUFFER is a pointer to TBUFFER, where is ipBufBlock initialized? If it isn’t, ipBufBlock may point to anything – even memory that cannot be read and thus not be written to the file.

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

Sidebar

Related Questions

I am using following PHP code for trigger creation but always get error, please
I have get error with the following code and i can't figure it out.
I Get Error when i use the following code str = Insert into BasicData
In a php page I have following code: if($_REQUEST['c']!=) // I get error on
Why do I get error in this code?Even if i do not link but
I use the following jquery statements but i get error in this function onGetDataSuccess(result)
I have enum list and method and i get error: not all code paths
I get this error in my smtdplugin implementation file , when i try to
Some of my visitors get error while loading page: The following error was encountered:
I get the following error while running my app. '-[NSCFString sizeWithTextStyle:]: unrecognized selector I

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.