[Wine] Linux Equivalent of SetFilePerm() api

Sven Willenberger svenw at intercom.net
Thu Apr 19 09:46:09 CDT 2007

On Mon, 2007-04-16 at 15:26 +0530, Vk Cherukuri wrote:
> Hi everyone,
> We are trying to port our own windows application to SUSE linux.Our
> application uses SetFilePerm() api defined in commondll.dll.We would like
> to know whether there is a linux equivalent of windows commondll.dll in
> wine...
> If not then what could be the possible alternative to make this api
> function exactly  as it does in windows.
> Waiting for an early reply,
> Thanks and Regards,
> Vijay.
> Vijaya Krishna Cherukuri
> Tata Consultancy Services
> Mailto: vk.cherukuri at tcs.com
> Website: http://www.tcs.com

Assuming you are using C or C++ then you are probably looking for chmod
(2) :

#include <sys/types.h>
#include <sys/stat.h>

int chmod(const char *path, mode_t mode);
int fchmod(int fildes, mode_t mode);

       Modes are specified by or'ing the following:

              S_ISUID   04000 set user ID on execution
              S_ISGID   02000 set group ID on execution
              S_ISVTX   01000 sticky bit
              S_IRUSR   00400 read by owner
              S_IWUSR   00200 write by owner
              S_IXUSR   00100 execute/search by owner
              S_IRGRP   00040 read by group
              S_IWGRP   00020 write by group
              S_IXGRP   00010 execute/search by group
              S_IROTH   00004 read by others
              S_IWOTH   00002 write by others
              S_IXOTH   00001 execute/search by others

Also chown (2)

#include <sys/types.h>
#include <unistd.h>

int chown(const char *path, uid_t owner, gid_t group);
int fchown(int fd, uid_t owner, gid_t group);
int lchown(const char *path, uid_t owner, gid_t group);

More information about the wine-users mailing list