Skip to content

Instantly share code, notes, and snippets.

Created February 10, 2018 16:38
Show Gist options
  • Save anonymous/dfe9337227ff7842785180f4a198a990 to your computer and use it in GitHub Desktop.
Save anonymous/dfe9337227ff7842785180f4a198a990 to your computer and use it in GitHub Desktop.
1 sub scan { │···········
2 say " - Scanning for new posts"; │···········
3 $latest = 0; │···········
4 for dir('posts') -> $file { │···········
5 $latest++ if !$file.basename.starts-with('.') && $file.basename.ends-with('.html'); │···········
6 } │···········
7 @titles = Nil; │···········
8 loop (my $i = $latest; $i > 0; $i--) { │···········
9 @titles[$latest - $i] = "posts/$i.html".IO.lines[0]; │···········
10 } │···········
11 }
Unhandled exception in code scheduled on thread 4 │···········
Failed to open file /root/blog/posts/1.html: Too many open files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment