Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8663925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:06:52+00:00 2026-06-12T17:06:52+00:00

I am working on some c code and am trying to programmatically create a

  • 0

I am working on some c code and am trying to programmatically create a directory. I found a while ago the mkdir(file, “w+) function to make the directory writable once its created but I’ve just noticed its creating a warning when compiled

warning: passing argument 2 of âmkdirâ makes integer from pointer without a cast

Below is the code I am using

void checkLogDirectoryExistsAndCreate()
{
    struct stat st;
    char logPath[FILE_PATH_BUF_LEN];
    sprintf(logPath, "%s/logs", logRotateConfiguration->logFileDir);
    if (stat(logPath, &st) != 0)
    {
        printf("Making log directory\n");
        mkdir(logPath, "w+");
    }
}

Thanks for any help you can provide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:06:53+00:00Added an answer on June 12, 2026 at 5:06 pm

    According to this manpage, the 2nd parameter is a mode_t, which is a numeric type and gives the wanted access mode of the directory. Here you should provide 0777, an octal number meaning all of r, w and x, and this is restricted by the umask.

    I don’t know which of these informations apply to Windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with some code that I've found online and I don't quite understand
I am currently working on some C code and I am trying to convert
I am trying to get some code working from an example I came across.
I am working with some test code to create Visio documents. I am using
I've been trying to get some working Java code to use for encrypting Paypal
I'm working off some code for a drop-down menu I found here on stack
I am working with some code I found online: def person_path(options) # This is
I'm working with some legacy code, and trying to get it to compile in
I am trying to get some code in a view working. I have declared
I'm working on some code that was originally made in MSVC and I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.