Add: add stackIndex opt to specify the index of stack for getting file information.