commit | c480ee32669fffd940de34f2f55d8c144c32f706 | [log] [tgz] |
---|---|---|
author | Adam Tkac <atkac@redhat.com> | Mon Feb 07 10:46:45 2011 +0000 |
committer | Adam Tkac <atkac@redhat.com> | Mon Feb 07 10:46:45 2011 +0000 |
tree | c3f4b5146fbe5e349cd31b30bea5175177304789 | |
parent | 437b0c2fc39f6d4bcdb5ffe7f8d2c28e1df166e3 [diff] [blame] |
[Development] os: introduce new function called "fileexists" git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4255 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/os/os.cxx b/common/os/os.cxx index c08b572..46470ea 100644 --- a/common/os/os.cxx +++ b/common/os/os.cxx
@@ -85,3 +85,13 @@ return 0; } +int fileexists(char *file) +{ +#ifdef WIN32 + return (GetFileAttributes(file) == INVALID_FILE_ATTRIBUTES) ? -1 : 0; +#else + return access(file, R_OK); +#endif +} + +