Verify if a file already exist ?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Verify if a file already exist ?

Post by Cpasjuste »

Hello here, for the shell i'm working on i would like to search if a file exist or not in a directory. For this i can use a code like sceIopen to see what it return. But i'm sure there is a faster way to look if a file exist. I'm not really skilled so help would be cool hehe :x
Thanks in advance .
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Code: Select all

if(access("blah.txt",F_OK)) file_exists();
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Many thanks it work faster than the old method hehe. I had to put the unistd.h include and thats ok.
Post Reply