By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,885 Members | 1,469 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,885 IT Pros & Developers. It's quick & easy.

File ownership check

P: n/a
Hello;

I want to write a C program that check file ownership in /bin
directory(ls, mkdir...). But I don't know how I start. I'm happy with
your helping.
Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Benden Ziyade wrote:
Hello;

I want to write a C program that check file ownership in /bin
directory(ls, mkdir...). But I don't know how I start. I'm happy with
your helping.


Do you want to check whether you have ownership, or just print who
has ownership?

Nov 14 '05 #2

P: n/a
Benden Ziyade <be*******@gmail.com> wrote:
I want to write a C program that check file ownership in /bin
directory(ls, mkdir...). But I don't know how I start. I'm happy with
your helping.


Sorry, but there isn't any function to determine the "ownerships" of
file in C (and also no function to list directories etc.), so you
need some system-specific extensions. Since what you write looks a
bit like you're using some UNIX-like system comp.unix.programmer
would probably be the right group to ask (and where you might get told
to use the stat(2) function).
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.