Re: open function
From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 09/25/05
- Next message: hirenshah.05_at_gmail.com: "problem in reading from file"
- Previous message: hirenshah.05_at_gmail.com: "open function"
- In reply to: hirenshah.05_at_gmail.com: "open function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 24 Sep 2005 20:24:50 -0500
hirenshah.05@gmail.com wrote:
> i am using open function to create a file. when i run the program for
> first time , it returns positive value. but when i run my program
> another time it is returning -1 (error).
>
> fd=open(path,O_CREAT|O_TRUNC|O_RDWR);
>
> fd = -1
>
> can anuone suggest how can i remove this bug.
>
If open() fails, it sets errno. Dump that and see what it's telling you.
Ed.
- Next message: hirenshah.05_at_gmail.com: "problem in reading from file"
- Previous message: hirenshah.05_at_gmail.com: "open function"
- In reply to: hirenshah.05_at_gmail.com: "open function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|