is equivalent to coding
which is to say, convert the string 'img' to uint8 and then throw the result away.
To test whether a file exists, use
Be warned though that this could use up cpu time like crazy and prevent other things from happening on the system.
Also be warned that this could potentially go true as soon as the file is created, which is probably not what you want. What you want to know is when the camera software has finished writing to the file. There really isn't any way to know that, unless the camera software takes the precaution of creating the file under a different name and renaming it to the known name after it has finished writing to it. With Windows, you also might get lucky and have it refuse to open the file if it is being written to by another program, but I wouldn't want to count on that.
Filesystems are usually designed for cooperative multitasking (i.e., all programs interested in a file use some common protocol to know if access is okay). The alternative, mandatory locking, has well known problems with "deadlocks", and supporting mandatory locking properly can require that the operating system periodically takes a complete "snapshot" of a program, and when a deadlock occurs, "unwinds" the program states to the point where there is no more deadlock. This can get messy, as the state of all other processes that are being communicated with might also have to be unwound. Messy, messy, messy. So much so that it is seldom implemented, as it is often much less hassle to go back and write all the other programs to use cooperative multitasking.