stat() doesn't find a file in c++

Posted by user1432779 on Stack Overflow See other posts from Stack Overflow or by user1432779
Published on 2012-10-22T16:52:04Z Indexed on 2012/10/22 17:00 UTC
Read the original article Hit count: 265

Filed under:
|
|
|

on Linux 12.04 I have an executable file located in say:

/a/b/exe

and a config file on

/a/b/config

when doing:

cd /a/b/ ./exe

everything's ok and the stat function finds the file config on /a/b/

HOWEVER,when running from root

/a/b/exe

the stat doesn't find the config file

any idea why?

it makes it impossible to run the binary using a script that isn't ran from the folder of the exe....

Thanks

© Stack Overflow or respective owner

Related posts about c++

Related posts about linux