uutils/coreutils

sort opens too many files

クローズ

#5,714 opened on 2023/12/24

 (13 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (1,981 件のフォーク)batch import
U - sortgood first issue

Repository metrics

Stars
 (23,893 個のスター)
PR merge metrics
 (平均マージ 5d 23h) (30d で 239 merged PRs)

説明

With our implementation:

mkdir -p in

for i in $(seq 5); do
  echo $i >in/$i
done

(seq 6 && echo 6) >exp
echo 6 >out
(exec 3<&- 4<&- 5<&- 6<&- 7</dev/null 8<&7 9<&7 &&
 ulimit -n 10 &&
 sort -n -m --batch-size=7 -o out out in/1 in/2 in/3 in/4 in/5 out
)

returns: sort: failed to open temporary file: Too many open files GNU works without issue

Tested by GNU in tests/sort/sort-merge-fdlimit.sh

コントリビューターガイド