View topic - Error when reading or writing

Error when reading or writing

anything that doesn't fit to other groups.

Error when reading or writing

Postby rashidmirza » Sun Dec 25, 2011 12:34 pm

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?
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: Error when reading or writing

Postby maschoen » Sun Dec 25, 2011 7:39 pm

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?
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm

Re: Error when reading or writing

Postby rashidmirza » Mon Dec 26, 2011 1:10 pm

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..
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am

Re: Error when reading or writing

Postby maschoen » Mon Dec 26, 2011 7:45 pm

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.
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm

Re: Error when reading or writing

Postby rashidmirza » Tue Dec 27, 2011 12:53 pm

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
rashidmirza
Active Member
 
Posts: 55
Joined: Sun Jun 13, 2010 4:32 am


Return to General Programming

Who is online

Users browsing this forum: No registered users and 4 guests