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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:25:35+00:00 2026-06-04T06:25:35+00:00

I want my users to be able to drop a folder into my OSX

  • 0

I want my users to be able to drop a folder into my OSX app. I then look at all the files in the directory and its subdirectories. That works fine but not when there is an alias in the directory. The alias is resolved correctly (Thanks to Matt Gallagher, shame on you Apple) but the enumerator does not allow me to do enumerate the target directory (it just returns no elements and the error below). Here is some sample code:

-(void)enumDirAtPath:(NSString*)path  {
    NSString* file_enum = nil;
    NSDirectoryEnumerator* enumerator = [[NSFileManager defaultManager] enumeratorAtPath:path];
    while (file_enum = [enumerator nextObject])
    {
        NSString* file =  [[NSString stringWithFormat:@"%@/%@",path,file_enum] stringByResolvingSymlinksAndAliases];

        BOOL isDirectory = NO;
        [[NSFileManager defaultManager] fileExistsAtPath:file isDirectory: &isDirectory];
        if (!isDirectory) {
            NSLog(@"Adding file: %@",file);
        } else {
            NSLog(@"Found dir: %@",file);
           [self enumDirAtPath: file];
        }
   }
}

the same code with enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: gives me this error:

error: Error Domain=NSCocoaErrorDomain Code=257 “The file “Musik”
couldn’t be opened because you don’t have permission to view it.”
UserInfo=0x1094cf670
{NSURL=file://localhost/Users/david/Desktop/Musik,
NSFilePath=/Users/david/Desktop/Musik, NSUnderlyingError=0x1094d43f0
“The operation couldn’t be completed. Operation not permitted”}

Even If I just dispatch_async the recursive call it won’t let me do it. Is there any way I can just iterate over a directory and get all the content?

Note: I am fully aware that this could result in infinite loops. This code is just to illustrate the problem.

  • 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-04T06:25:36+00:00Added an answer on June 4, 2026 at 6:25 am

    I‘m pretty damn sure the answer is right there in the error message:

    The file “Musik” couldn’t be opened because you don’t have permission to view it.

    Reveal the destination of the alias in the Finder application and check its permission via “Get Info” or ls -l@ in the Terminal — I’d bet that your user account david is not being granted one of the following permissions:

    • read
    • execute
    • list

    The last one will typically not be visible on the command line except in combination with an explicit deny-access-control-entry.

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

Sidebar

Related Questions

I want users to be able to upload files via FTP to my site
In my app I want users to be able to associate a file(s) they
In my Rails app I want users to be able to input video links
I have an app where we want users to be able to send us
In my app, users can drag and drop different image files to create a
Similar Stack Overflow Question I want users to be able to search through my
I have a situation where I want users to be able to specify a
I have some pages that I don't want users to be able to access
I am creating a game currently and I want users to be able to
I'm writing a small blog module. I want the users to be able to

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.