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 8590829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:23:03+00:00 2026-06-11T23:23:03+00:00

Im trying to create an folder in user library directory,but its not creating. Is

  • 0

Im trying to create an folder in user library directory,but its not creating. Is there any mistake in the below code.

databaseName = @"KITSMAW0051_DB.sqlite";
// Get the path to the documents directory and append the databaseName
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
NSString *folder = @"Swasstik";
databasePath = [[documentsDir stringByAppendingPathComponent:folder ] stringByAppendingPathComponent:databaseName];
  • 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-11T23:23:05+00:00Added an answer on June 11, 2026 at 11:23 pm

    Ok first of all databasePath describes a path to a file not a directory. But let’s say you actually want to create “Swasstik” folder inside user’s Library:

    // Your code
    NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
    NSString *documentsDir = [documentPaths objectAtIndex:0];
    NSString *folder = @"Swasstik";
    // I edited here to keep only the folder
    NSString *folderPath = [documentsDir stringByAppendingPathComponent:folder];
    
    // At this point we got the path to the folder
    // but we want to actually go on and create it
    // NSFileManager to the rescue!
    NSFileManager *manager = [NSFileManager defaultManager];
    [manager createDirectoryAtPath: folderPath
     withIntermediateDirectories: NO
     attributes: nil
     error: nil];
    

    Of course you can study and set the manager as you like and also implement some error handling. I hope that this makes sense…

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

Sidebar

Related Questions

I am trying to create folder like this $destination = ../folder_name/_pcode/../_compile; mkdir($destination); But this
I am trying to create a file directory (folder) in the 32 bit Program
I'm trying to let the user create either a file or a folder. So
I'm trying to create an app launcher in vb.net but I do not know
I'm trying to create a folder and create a file within it. Whenever i
I am trying to create a folder in launcher application from the settings application.
I am trying to create a small assembly program to create a folder. I
So I'm trying to dynamically create a folder inside the web pages folder. I'm
I'm trying to create cookie from one folder that will also work in another.
I am trying to create a program similar to Folder Lock which prevents users

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.