Error when reading or writing

I have a process which reads a directory from a QNX platform and then write the contents of the directory to a windows platform. Common Internet File system has been used for the QNX and windows platform has been mounted locally to a qnx folder.
The issue is that whenever there is a read from the QNX directory i get a error 9 , which translates to EBADF. Although the process works properly, as in, it would read the source directory, then move it across to a windows platform, and then delete the source directory, i am eager to know the reason for the error.
Any suggestions?

You didn’t post any code, so we have no way of knowing if the BADF is a coding mistake. My guess is that it is either an I/O error, or some artifact of using CIFS, which probably can be checked for and ignored.

I recall that when using “cp” o a CIFS file, I always saw an error related to the lack of attribute/permission support of CIFS. Could your problem be related to that?

I will try giving the key programming statements:

int MvDirectoryWindowsPath(char *Source, char Target)
{
//declarations
DIR *pDirectory;
struct dirent *pDirectoryObject;
mkdir(Target, S_IRWXU | S_IRWXG | S_IRWXO);

 pDirectory = opendir (Source);
 pDirectoryObject = readdir (pDirectroy);

 //return a suitable integer as per error checks

}

where Source would be a QNX folder path such as /home/test.
where Target would be a Windows folder path such as /home/test/windows

and the windows folder has been mounted in the following manner:
fs-cifs -l //testpc: 192.168.X.X:/Shares /home/test/windows

The windows share folder has been given full share with read and write permissions…

I would suggest two sanity checks.

  1. What does “$ ls -l /home/test/windows” produce?

  2. What is the return code form opendir(Source)?

If both of these are normal, then you have a strange problem.

  1. ls -l /home/test/windows displays whatever is in the windows share folder

  2. still have to place my program in debug mode, and get the value of return code