Hi,


I have written a simple file operation program as follows:

#include "vxWorks.h"
#include "stdio.h"
#include "unistd.h"

int vmain() {
int fd, n;
fd = open("file1",O_CREAT|O_RDWR,0644);
printf("%d\n",fd);
n = write(fd, "Hi", 3);
printf("%d\n", n);
close(fd);

return 0;
}

When i compile and download this to target server and then run, i am getting following thing displays on the target simulator

-1
-1

What may be the error? Why open, write are failing? Why files are not being created?
Plz guide me.

Regards,
Vinaykumar