read_async


Description:

public async string read_async () throws Error

Read file contents asynchronously.

Checks file modification time and reloads buffer if file was modified since last read. Updates buffer text and last_read_timestamp.

Behavior

  • Gets file modification time from filesystem
  • Compares with last_read_timestamp
  • If file was modified (or first read), reloads from disk using read_async_real()
  • Updates buffer text and last_read_timestamp
  • Sets is_loaded = true
  • Returns current buffer contents

Returns:

File contents as string

Exceptions:

Error

if file cannot be read