Reputation: 5760
I want to use spawnl to restore a DOS terminal session after my application has completed, I'm doing the following:
static char* pszMode = "mode.com";
int intRC = spawnl(P_WAIT, pszMode, pszMode, "co80", NULL);
char szCOM2setup[80];
sprintf(szCOM2setup, "%s:9600,n,8,1", clsPort::mpcszCOM2);
intRC = spawnl(P_WAIT, pszMode, pszMode, szCOM2setup, NULL);
mpcszCOM contains COM2
In both cases intRC contains -1, I've single stepped execution and it doesn't look like these commands are being properly executed, what haven't I done?
I'm using ROM-DOS version 6.22 on an embedded PC104 platform.
I've checking with perrror and using strError, the actual error is:
No such file or directory
But why? The path is set-up before the application is launched and mode.com is accessible from the command line in the same folder as the application.
Tried using spawnlp instead of spawnl, no better same error.
Upvotes: 0
Views: 698
Reputation: 5760
For a reason I don't understand even though the path is set-up correctly, the application was returning "No such file or directory" so I modified the application to include the path and this resolved the issue.
Upvotes: 0