in reply to Unable to reach branch - Dead code or defensive programming?

How about the case where a file is truncated between the stat call and the read call. Definitely not dead code. Hard to test, possibly. If you wish to test it, you could wrap the read call into another sub, and mock that sub within your test.

--MidLifeXis

  • Comment on Re: Unable to reach branch - Dead code or defensive programming?