473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

file or directory and st_mode

a
struct stat* buf
buf->st_mode

Is there any marco can construct the type and permission string, like
drwx------, by passing the st_mode?
Thanx
Nov 15 '05 #1
1 2456
a wrote:
struct stat* buf
buf->st_mode

Is there any marco can construct the type and permission string, like
drwx------, by passing the st_mode?


Note that there are no directories from the standard C point of view.
struct stat is not known to me, neither is st_mode, the code does not
compile, no source is provided: This cannot be answered.

Learn how to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html

Hint: If your answer solely depends on what st_mode can contain,
then you should state what it contains, otherwise mention all
additional conditions.

If there is not a very clear and obvious relationship between
the desired string and st_mode, I would rather use a function
than a macro.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: achrist | last post by:
After using the McMillan installer and executables built with it for a while, I've noticed some residual files accumulating on my disk. The installer docs mentions these. Here's code I wrote...
6
by: User | last post by:
Anyone have ideas which os command could be used to get the size of a file without actually opening it? My intention is to write a script that identifies duplicate files with different names. I...
0
by: ismael | last post by:
Hi all I have some problems to get the the permissions on windows. I use a simple code that run perfectly in UNIX but give me wrong information on Windows. I found this code searching by google:...
14
by: henrik.sorensen | last post by:
Hi List, I am looking for a way to do a case insensitive search for file names. Anybody have some hints ? thanks Henrik pl1gcc.sourceforge.net
6
by: Ben | last post by:
Hello, I hope this is the correct group for this posting :-) For the following kind of code fragment: ofstream filestream; filestream.open(path); if(!filestream.is_open()) { cerr<< ......
0
by: grejon04 | last post by:
I'm trying to write a script that will look into a directory, and check each entity to see if it is a directory or a file. (Borland CodeGear RAD Studio) Here's what I have so far. #include...
3
by: Deniz Dogan | last post by:
Hello. I have a question regarding the st_mode field of the "stat" struct in sys/stat.h. I'd like to know how to use the S_IRWXU, S_IRWXG and S_IRWXO flags to mask the mode_t value into human...
1
by: Christian Heimes | last post by:
William Purcell wrote: (33188, 362259, 2053L, 1, 0, 0, 1690, 1218550501, 1218118498, 1218118498) 1218118498.0
0
by: Virgil Stokes | last post by:
Christian Heimes wrote: Is it possible to change the time stamp of a file (Win2K platform)? If yes, how?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.