| Grey Acumen said: But while god will know wether or not the file is there, teh program doesn't neccesarily know, hence the reason hed use exception handling or some variant therof. |
Well, not entirely... there are ways to check if a file exists before trying to access it. Using Exceptions is the easiest (safest?) method because you don't have to check and between the time that you check and the time the file is open, if someone (for instance) ejects the disk, then your open will fail, but we are talking microseconds and if someone ejected the disk with or without exception handling, it would get ugly either way.
You could for instance use stat() or _stat()/_fstat() Which is a POSIX function and not part of the standard C library...
So, no.. the computer program can know if the file exists, some just choose to take a leap of faith and open it in an exception block and trust it's there, dealing with the consequences of it failing. It's not that the program doesn't know. It's that it doesn't have the built in tools to know.
Which seems to fit in this conversation quite well. :)
Edit: Jeeze.. I'm falling behind the debate here... time to go to bed I guess.
It seems the mods need help with this forum. I have zero tolerance for trolling, platform criticism (Rule 4), and poster bad-mouthing (Rule 3.4) and you will be reported.
Review before posting: http://vgchartz.com/forum/rules.php







