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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:12:41+00:00 2026-06-15T13:12:41+00:00

With following code i write an dest : array of Bytes; to a file.

  • 0

With following code i write an

  dest : array of Bytes;

to a file.

  c: integer;
  size: integer;

If i do it Byte by Byte:

  filename := ExePath + 'test.txt';
  AssignFile(myfile, filename);
  ReWrite(myfile, 1);
  Write the data array to the file
  for c := 0 to length(dest) - 1 do
     BlockWrite(myfile, dest[c], 1);
  CloseFile(myfile);

everything works fine, but takes ages on large arrays (20MB biggest).

If i try to write it @ once i get I/O Error 1784:

  filename := ExePath + 'test.txt';
  AssignFile(myfile, filename);
  size := length(dest);
  ReWrite(myfile, size);
  BlockWrite(myfile, dest[0], size);
  CloseFile(myfile);

Where is may fault?
Thanks in advance.

  • 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-15T13:12:42+00:00Added an answer on June 15, 2026 at 1:12 pm

    Got it…

    @ myself: RTFM

    BlockWrite(myfile, dest[0], size);
    

    must be

    BlockWrite(myfile, dest[0], 1);
    

    cause size is defined already to the size of the array with rewrite….

    filename := ExePath + 'test.txt';
    AssignFile(myfile, filename);
    size := length(dest);
    ReWrite(myfile, size);
    BlockWrite(myfile, dest[0], 1);   <-- 1 "dataset" of length (size) as defined before
    CloseFile(myfile);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using the following code to write an array to the file: FileWriter
Using the following code to write to a file int main(int argc, char *
Given the following code (it's supposed to write helloworld in a helloworld file, and
I have written the following code to write to a file on external storage:
I often write the following code: print('object', 'moved', 'from =', object.location, 'dest =', new_location)
I have written the following code to write a file on my local file
I am using following code to write in file in, but problem occurred when
So, I've got the following code to write to a file: Formatter output =
I'm using the following code to write data through a named pipe from one
If I write the following code: session_start(); $_SESSION['user_id']='daniel'; the variable stays fine as long

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.