mkfifo
Version, currently main branch1 version
- main branchlatestJan 29, 2022
github.com/tijn/mkfifo.cr
A Crystal implementation of File.mkfifo
Installation
# Add this to your shard.yml
dependencies:
mkfifo:
github: tijn/mkfifo.cr
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.3.2- License
- MIT
- Author
- Tijn Schuurmans
Dependencies
This version declares no dependencies.
README
mkfifo
This small library monkey patches File to add two new class methods: fifo and fifo?.
I made this because:
- I need it for my hobby project
- I found this dicussion about it, so others need it too
It's basically a copy of Ruby's File.mkfifo, but I changed the permissions to match Crystal's default for new files.
Installation
-
Add the dependency to your
shard.yml:dependencies: mkfifo: github: tijn/mkfifo -
Run
shards install
Usage
require "mkfifo"
path = File.tempname
File.mkfifo(path)
File.fifo?(path) # ==> true
# read from the fifo, for example
File.each_line(path) do |line|
puts line
end
# or write to it:
File.open(path) do |fifo|
fifo.puts("foo and bar")
end
Contributing
- Fork it (https://github.com/tijn/mkfifo/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Tijn Schuurmans - creator and maintainer
Alternatives
I just found fifo.cr which takes a different approach, that is arguably somewhat cleaner since it avoids monkey patching.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Jan 29, 2022
- Crystal
1.3.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/tijn/mkfifo.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1