Hi,
How to create directory on usb drive of remote machine.
I mounted the remote machines driver path to local path
ex: mount -T nfs IPAddressOfRemoteMachine:/fs/usb0/ /fs/usb0/
and I execute the following code with parameter /fs/usb0/NewFolder/:
int main(int argc, char *argv[]) {
bool bExists = true;
int ierrvalue=0;
int imessage=0;
errno = EOK;
char *pDirPath=argv[1];
imessage = mkdir(pDirPath, S_IRWXU | S_IRGRP | S_IXGRP
| S_IROTH | S_IXOTH);
ierrvalue = errno;
cout<<"imessage "<<imessage<<endl;
if (-1 == imessage) {
if (EEXIST==ierrvalue) {
cout<<"dir exists "<<endl;
bExists = true;
} else if ((EACCES==ierrvalue) || (ENOTDIR==ierrvalue) || (EROFS
==ierrvalue)) {
cout<<"dir not created "<<endl;
bExists = false;
}
cout<<"ierrvalue "<<ierrvalue<<endl;
} else {
cout<<"dir created "<<endl;
}
std::cout << "Welcome to the QNX Momentics IDE" << std::endl;
return EXIT_SUCCESS;
}
This mkdir function is always returning -1, and not creating the folder on the usb drive of Remote Machine.
If any have idea on this, please share.
Thanks in Advance.