Sign inSign up free

1444. Fix a Script That Runs Out of File Handles

medium 20 XP ~10 minHands-on lab Pro

/home/student/stats/count_lines.py DIR counts the files in a folder and their total number of lines. On the build server it crashes with OSError: [Errno 24] Too many open files on big folders. The server limits each process to 64 open files (ulimit -n 64), and that limit stays.

This is a Pro problem

Pro unlocks every lab and quiz, all roadmaps and a full daily plan.

Unlock with Pro

Part of Python for DevOps. Next step: Days Until Expiry, Across Time Zones

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Pro lab

Upgrade to open a machine for this problem.

See Pro