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

  • Home
  • SEARCH
  • 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 3406812
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:40:26+00:00 2026-05-18T05:40:26+00:00

How can I combine a open(Filename, {delayed_write, Size, Delay}) with an index on where

  • 0

How can I combine a open(Filename, {delayed_write, Size, Delay}) with an index on where to write this data to?

I want to wait until I receive a certain amount of data and then write it to a position in the file.

Also is {read_ahead, Size} the opposite of {delayed_write, Size, Delay}? I would like to read a certain amount of data to send it.

Thanks

  • 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-18T05:40:27+00:00Added an answer on May 18, 2026 at 5:40 am

    read_ahead is kind of the opposite of delayed_write in the sense that reading is the opposite of writing.

    If you want to read and send bigger chunks of memory you don’t need read_ahead, just read big chunks and send them (not many os calls to save here).

    From the file:open/2 manpage on read_ahead:

    If read/2 calls are for sizes not significantly less than, or even greater than Size
    bytes, no performance gain can be expected.

    You don’t need to specify and index when opening. Just use pwrite/3 or a combination of position/2 and write/2.

    But writing in different positions of the file might just reduce the gain of delayed_write since (also manpage of file:open/2):

    The buffered
    data is also flushed before some other file
    operation than write/2 is executed.

    If you have chunks of data for several positions collect them in a list of {Location, Bytes} and from time to time write them with file:pwrite/2 all in one go. This can map to very efficient writev(2) system call that writes several chunks in one go.

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

Sidebar

Related Questions

I know you can combine multiple table-selects using a Join statement but is there
Can you tell me examples for jquery with ajax? Can I combine an UpdatePanel
I can open file at a specific line in mvim (on OSX, gvim on
If all tables I want to delete from have the column gamer_id can i
I want to use a temp directory that will be unique to this build.
I want to change a couple of files at one time, iff I can
If you want to start another process and wait (with time out) to finish
I have multiple columns in an Access DB, I want to combine the fields
I have a set of options, some orthogonal (can be combined in any combination),
Can somebody point me to a resource that explains how to go about having

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.