How to create a directory on Remote machine

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
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;


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.

I have two guesses.

  1. You don’t have permission to write to this NFS disk. Can you create a file there?

  2. You have write permission, but the directory permissions you are requesting are causing a problem.