txt: ## openforwriting.md
  class X::Proc::Async::OpenForWriting
  
  Error due to writing to a read-only Proc::Async object
  
  ```raku
  class X::Proc::Async::OpenForWriting is Exception {}
  ```
  
  When a [`Proc::Async`](/type/Proc/Async) object is opened only for reading from the external program (no `:w` passed to open), and a write operation such as `write`, `print` and `say` is performed, an exception of type `X::Proc::Async::OpenForWriting` is thrown:
  
  ```raku
  my $proc = Proc::Async.new("echo");
  $proc.start;
  $proc.say(42);
  CATCH { default { put .^name, ': ', .Str } };
  # OUTPUT: «X::Proc::Async::OpenForWriting: Process must be opened for writing with :w to call 'say'␤»
  ```
  
  To fix that you can use writable commands with :w flag:
  
  ```raku
  my $prog = Proc::Async.new(:w, 'cat');
  $prog.stdout.tap( -> $str {
      print $str;
  });
  my $promise = $prog.start;
  await $prog.say('foo');
  $prog.close-stdin;
  await $promise;
  ```
  
  # [Methods](#class_X::Proc::Async::OpenForWriting "go to top of document")[§](#Methods "direct link")
  
  ## [method method](#class_X::Proc::Async::OpenForWriting "go to top of document")[§](#method_method "direct link")
  
  ```raku
  method method(X::Proc::Async::OpenForWriting:D:)
  ```
  
  Returns the method name that was called and which caused the exception.
  