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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:52:08+00:00 2026-05-10T19:52:08+00:00

Simply moving the file to ~/.Trash/ will not work, as if the file os

  • 0

Simply moving the file to ~/.Trash/ will not work, as if the file os on an external drive, it will move the file to the main system drive..

Also, there are other conditions, like files on external drives get moved to /Volumes/.Trash/501/ (or whatever the current user’s ID is)

Given a file or folder path, what is the correct way to determine the trash folder? I imagine the language is pretty irrelevant, but I intend to use Python

  • 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. 2026-05-10T19:52:08+00:00Added an answer on May 10, 2026 at 7:52 pm

    Alternatively, if you’re on OS X 10.5, you could use Scripting Bridge to delete files via the Finder. I’ve done this in Ruby code here via RubyCocoa. The the gist of it is:

    url = NSURL.fileURLWithPath(path) finder = SBApplication.applicationWithBundleIdentifier('com.apple.Finder') item = finder.items.objectAtLocation(url) item.delete 

    You could easily do something similar with PyObjC.

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

Sidebar

Related Questions

I realise that FileSystemWatcher does not provide a Move event, instead it will generate
I was contemplating moving to a version control system at work, but the learning
Simply Asking, Is there any function available in mysql to split single row elements
Simply I need to write echo t${count} = $t${count} To a text file, including
I have an .ear file which contains multiple war files. I am moving the
I am needing to write a script that will move files to a destination
Simply put, my config file includes my database class, and the config file has
We are moving to TFS 2010 (from PVCS) for source control and work item
I'm new to Java. I'm simply trying to build a .jar file of my
Simply put: What is the most effective way to share / reuse code between

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.