59 points by Uptrenda 4 days ago | 49 comments | View on ycombinator
castral 4 days ago |
ycombiredd 4 days ago |
https://web.archive.org/web/19991109163128/http://www.dfw.ne...
Using named pipes in this manner also enabled a hackish method to create server-side dynamic web content by symlinking index.html to a file created in this manner, which was a secondary motivator, which seems kinda quaint and funny now, but at that time, it wasn't very long after just having finally decommed our gopher server, so fingerd was still a thing, Apache was fairly new, and I may still have been trying to convince management that the right move was not from ncsa httpd to Netscape Enteprise Server, but to Apache+mod_ssl. RSA patent licensing may still have been a thing too. Stronghold vaguely comes to mind, but I digress.
Yeah, programs that do stuff based on filename, like busybox. Oh, and this long forgotten artifact this article just reminded me of that I managed to find in the Wayback Machine, a tool to mknod a named pipe on a SunOS 4.1.4 machine, to get server-side dynamic content when remotely accessing a daemon that was supposed to return content from a single static file. Ah, memories.
CrendKing 4 days ago |
trashb 3 days ago |
However I would like to point out that you are limited to path and filename length.
Maximum file path length in Windows is 260 characters. (32767 characters with longpath enabled). Individual filenames max out at 255 characters.
Maximum file path length in Linux/Unix generally is 4096 characters. On ext4 it seems max filename length is 255 bytes.
Additionally you will be constrained by the characters allowed in files. Therefore it will be strange to pass a filepath to a program like this.
krick 4 days ago |
cheevly 3 days ago |
```
@echo off setlocal
set "PROMPT=%~n0"
setx OPENAI_API_KEY "sk-proj-x" >nul 2>&1
powershell -NoProfile -Command ^ "$env:OPENAI_API_KEY='%OPENAI_API_KEY%';" ^ "$files = Get-ChildItem -File | ForEach-Object { $_.Name };" ^ "$filesList = $files -join ', ';" ^ "$systemPrompt = 'You are only allowed to respond with executable PowerShell commands. The folder contains these files: ' + $filesList;" ^ "$userPrompt = '%PROMPT%';" ^ "$body = @{ model='gpt-5.4'; messages=@(@{role='system'; content=$systemPrompt}, @{role='user'; content=$userPrompt}) } | ConvertTo-Json -Depth 5;" ^ "$response = Invoke-RestMethod -Uri 'https://api.openai.com/v1/chat/completions' -Method Post -Headers @{ Authorization = 'Bearer ' + $env:OPENAI_API_KEY; 'Content-Type' = 'application/json' } -Body $body;" ^ "$psCommand = $response.choices[0].message.content;" ^ "Write-Host '---AI OUTPUT---';" ^ "Write-Host $psCommand;" ^ "Invoke-Expression $psCommand"
pause
```
japanuspus 4 days ago |
With some agreement on mapping (maybe just `%HH` for anything outside `A-Z a-z 0-9 . _ -`), this could be completely standardized and made part of standard library argument parsers.
I could see a bunch of my utility scripts replaced with a python script and a `uv` shebang if this was in argparse.
applfanboysbgon 4 days ago |
foo.exe
foo.config
foo.config contents:
--flag1 --flag3
--flag2 --flag5 some_param
run: `foo.exe --config 2`Compared to shell scripts, this is a portable solution that will work across different environments, and compared to including arguments in filenames, it's not insane and doesn't require duplicating the entire binary to maintain multiple configs. The only merit I see to the filename approach is that it gives you a single file instead of two (if you have exactly one config), but I don't think that tradeoff is worth it.
tehbeard 4 days ago |
csb6 4 days ago |
unixzii 4 days ago |
brzezmac 3 days ago |
abrookewood 4 days ago |
blacklion 3 days ago |
eternauta3k 4 days ago |
runlaszlorun 4 days ago |
endymion-light 4 days ago |
r4ppz 4 days ago |
Quarrelsome 4 days ago |
huflungdung 3 days ago |
rajesh_me291091 4 days ago |
RobertH50571758 4 days ago |