You can know this, renders initiated within render or into render view are saved out in the images tmp file bexcause they are PREVIEWS, and don't count as full fledged render. Off course you can easily querry whats in the view port.
On the otherhand if your suing bach render it goes into images diorectory or whetever sub pass your putting it into.
Also when you ask the hwRender to render:
$file=hwRender
;
it returns the filename so you don't need to guess or querry it at later date.
you can do something like this:
setAttr -type "string" defaultRenderGlobals.imageFilePrefix "C:/File";
hwRender -f 1 -cam persp
it wikll render to a file placed in c:/file_tmp.iff
There is porbably a way to get rid of the _tmp but i dont have time to read ALL the render nodes attributes trough.