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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:28:09+00:00 2026-06-12T16:28:09+00:00

Got a problem for how to determine file/folder in trash. There’s some solution on

  • 0

Got a problem for how to determine file/folder in trash.
There’s some solution on Internet, one of those is FSFindFolder.
which can be used something like this:

FSFindFolder(kUserDomain, kTrashFolderType, true, &trashRef);

but still don’t know how to pass the path of file that I want to determine using this method

  • 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-12T16:28:10+00:00Added an answer on June 12, 2026 at 4:28 pm

    The last parameter of FSFindFolder is a FSRef, which can be converted to a CFURLRef and to a NSURL:

    FSRef trashRef;
    FSFindFolder(kUserDomain, kTrashFolderType, true, &trashRef);
    CFURLRef urlRef = CFURLCreateFromFSRef(NULL, &trashRef);
    NSURL *trashUrl = CFBridgingRelease(urlRef);
    NSString *trashPath = [trashUrl path];
    NSLog(@"trash folder: %@", trashPath);
    

    (I have omitted the error checking for sake of brevity. I have also assumed that you use automatic reference counting.)

    Now you can check if a given file is in the trash folder:

    NSString *theFile = ...; // your file here
    NSString *fileInTrash = [trashPath stringByAppendingPathComponent:theFile];
    BOOL isInTrash = [[NSFileManager defaultManager] fileExistsAtPath:fileInTrash];
    NSLog(@"is in trash: %d", isInTrash);
    

    NOTE: On Mac OS X 10.8, FSFindFolder is deprecated, and you can use the following code to find the trash folder:

    NSString *trashPath = [NSSearchPathForDirectoriesInDomains(NSTrashDirectory, NSUserDomainMask, YES) lastObject];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a jsp file, which includes another jsp file to check some values
I got problem with sending data in Android using httpPost. I found some example,
I've got problem with DirectX in C#. I want to draw some lines. Firstly
I've got a pretty basic console program here, to determine if a folder or
I came across the following article which got me interested in this particular problem.
we've got a problem with one of our non dpi aware MFC applications. If
i got problem with my code and hopefully someone able to figure it out.
I've got problem for my application. I want to start connectbot from my application
I've got problem with connecting to MySQL database on my freshly installed Windows 7
have a nice day. I got problem when trying to create an image from

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.