Open a File in D
问题 If I want to safely try to open a file in D, is the preferred way to either try to open it, catch exception (and optionally figure out why) if it fails or check if it exists, is readable and only then open it I'm guessing the second alternative results in more IO and is more complex right? 回答1: Generally, it's better to check whether the file exists first, because it's often very likely that the file doesn't exist, and simply letting it fail when you try and open it is a case of using