Be aware that if you are creating a filename for a temporary index for a multiuser system, and the file is going to be located on the server, then you need to check for a unique filename in case another user had already created the one you wanted to use. Or, better, put the temp index file on the local PC, then you can use the same name each time and it will also run faster.
Regards,
James