On Mon, Dec 26, 2022 at 06:03:42AM +0800, wuwow...@gmail.com wrote:
> Sad... Not working...
> OpenBSD 7.1
> 
> #!/usr/bin/awk -f
> BEGIN {
>     d = "/tmp/test/";
>     system("mkdir -p " d);
>     i = -1;
>     while (++i < 1000) {
>          f = d i;
>          printf("") > f;

This opens f and leaves it open. You should close(f) if you no longer
need it.

>      }
> }
> 
> awk: can't open file /tmp/wow/125

Since you didn't close f, you ran into a limit of open files.

> 
> It' seems that "one true awk" is buggy...
> 

I would argue your script is buggy. It happens to work in GNU awk since
that has some file reuse logic.

Reply via email to