- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- E_NOENT while file exist !
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2004 04:40 AM
05-21-2004 04:40 AM
E_NOENT while file exist !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2004 04:43 AM
05-21-2004 04:43 AM
Re: E_NOENT while file exist !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2004 04:44 AM
05-21-2004 04:44 AM
Re: E_NOENT while file exist !
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2004 04:46 AM
05-21-2004 04:46 AM
Re: E_NOENT while file exist !
Ideally, you need errno and the system call that set it along with the actual parameters passed to the system call. Tusc can actually be used to yield these results for a process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2004 04:58 AM
05-21-2004 04:58 AM
Re: E_NOENT while file exist !
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=216102
and i thought it was gone...
Alas, it is back!
here is the code where I test the existence of the file:
It may say "file not exist" or it works fine (with the same file)
// Pour vérifier l'existence d'un fichier
bool fileExists(const char *filename)
{
// Initialise à NULL
FILE *fichier = NULL;
// Ouvre le fichier en lecture seulement
fichier = fopen(filename, "r");
// Si NULL est renvoyé c'est parce que le fichier n'a pas été trouvé ou bien qu'il est déjà ouvert(pas accessible...) ou autres...
if (fichier == NULL)
{
cout << "erreur fileExists " << string(filename, strlen(filename)) <<" , errno = " << errno <
}
// Ferme le fichier
fclose(fichier);
// Renvoie true, le fichier existe bien
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2004 05:24 AM
05-21-2004 05:24 AM
Re: E_NOENT while file exist !
In any event, sometimes it's nice to fall back on the old standards to print errors. I would replace the cout with
(void) fprintf(stderr,"Filename: \"%s\" errno: %d\n",filename,errno);
int i = 0,len = 0;
len = strlen(filename);
while (i < len)
{
if (filename[i] >= ' ' && filename[i] <= '~') (void) fprintf(stderr,"%c",filename[i])
else (void) fprintf(stderr,"|%03o|",(int) filename[i]);
++i;
}
(void) fprintf(stderr,"\n");
(void) fflush(stderr);
The idea is to detect any non-printable characters embedded in the filename.
One other observation, fopen is slightly removed from the actual system call open() so if you are really fighting a mysterious problem, you may want to use open instead so that you know it is what actually set errno although fopen should be close enough to the scene of the crime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2004 05:29 AM
05-21-2004 05:29 AM
Re: E_NOENT while file exist !
Anyway I will try your suggestions and let you know...
Thanks
Laurent