Skip to content

Not a directory error when reading from FIFOs #884

@theasp

Description

@theasp

Describe the bug

Unable to read from FIFOs as created when using process substitution in Bash.

To Reproduce

industrial:~$ aichat -f <(echo "I am a banana") "What type of fruit am I?"
Error: Not a directory: "/dev/fd/63"

Expected behavior

industrial:~$ aichat -f <(echo "I am a banana") "What type of fruit am I?"
 Based on the content of `/dev/fd/63`, you are a banana.

Screenshots/Logs

Configuration

model                   gt0:default
max_output_tokens       -
temperature             -
top_p                   -
dry_run                 false
stream                  true
save                    false
keybindings             emacs
wrap                    no
wrap_code               false
function_calling        true
use_tools               -
agent_prelude           -
save_session            -
compress_threshold      4000
rag_reranker_model      -
rag_top_k               4
highlight               true
light_theme             false
env_file                /home/asp/.config/aichat/.env
config_file             /home/asp/.config/aichat/config.yaml
roles_dir               /home/asp/.config/aichat/roles
sessions_dir            /home/asp/.config/aichat/sessions
rags_dir                /home/asp/.config/aichat/rags
functions_dir           /home/asp/.config/aichat/functions
messages_file           /home/asp/.config/aichat/messages.md

Environment (please complete the following information):

  • os version: Ubuntu 24.04
  • aichat version: 0.22.0
  • terminal version: WezTerm 20240203-110809-5046fc22

Additional context

https://tldp.org/LDP/abs/html/process-sub.html

industrial:~$ cat <(echo Hi)
Hi
industrial:~$ echo <(echo Hi)
/dev/fd/63
industrial:~$ stat -L <(echo Hi)
  File: /dev/fd/63
  Size: 0               Blocks: 0          IO Block: 4096   fifo
Device: 0,14    Inode: 395798740   Links: 1
Access: (0600/prw-------)  Uid: ( 5001/     asp)   Gid: ( 5001/     asp)
Access: 2024-09-24 12:35:44.396188697 -0300
Modify: 2024-09-24 12:35:44.397188709 -0300
Change: 2024-09-24 12:35:44.397188709 -0300
 Birth: -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions