I have the Group ID in stored in a gid_t variable.
Thanks.
I have the Group ID in stored in a gid_t variable.
Thanks.
anyone??
Explain!!!
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
I suspect this is an OS specific issue. You have folders/files assigned to a user group and want to find out what group they're in?
Otherwise:
> I have the Group ID in stored in a gid_t variable.
Otherwise, if you have the group id stored in a variable, just access the variable. Surely you can do that much!
Seriously, I think they're talking about an OS specific quesiton here.
Quzah.
OK, let me try and explain it a little better....
I have a program that traverses the file system and gets information on certain programs. I then use the getpwuid function to pull information about the file. I can get all the information I need except the group name of the owner of the file.
I can get the group ID, but not the name. What I need is to take the group ID and get the corresponding group name. I can't just check the /etc/group file, I was wondering if there was a function that does that.
Like I said before: This is an OS specific question. What OS are you using?
Quzah.
Ideally, this should work under Linux and HPUX.
http://www.cm.cf.ac.uk/Dave/C/node20...00000000000000Code:struct stat { mode_t st_mode; /* File mode (type, perms) */ ino_t st_ino; /* Inode number */ dev_t st_dev; /* ID of device containing */ /* a directory entry for this file */ dev_t st_rdev; /* ID of device */ /* This entry is defined only for */ /* char special or block special files */ nlink_t st_nlink; /* Number of links */ uid_t st_uid; /* User ID of the file's owner */ gid_t st_gid; /* Group ID of the file's group */ off_t st_size; /* File size in bytes */ time_t st_atime; /* Time of last access */ time_t st_mtime; /* Time of last data modification */ time_t st_ctime; /* Time of last file status change */ /* Times measured in seconds since */ /* 00:00:00 UTC, Jan. 1, 1970 */ long st_blksize; /* Preferred I/O block size */ blkcnt_t st_blocks; /* Number of 512 byte blocks allocated*/ }
You really should try your hand at using a search engine...
http://www.rt.com/man/getgroups.2.html /* useful */
http://www.rt.com/man/ /* the main index. bookmark it. */
http://www.rt.com/man/group.5.html /* surely it can't be that eas? can it? */
http://www.rt.com/man/groups.1.html
http://www.rt.com/man/setgroups.2.html
Quzah.
God damn this stupid timer. I hate this message board's login timer. How hard is it to simply notice that "hey, the window has the user signed in, perhaps they're still signed in, eh?" They need PER SESSION cookies. Not 2 second expiration.
Quzah.