Giter VIP home page Giter VIP logo

Comments (9)

sindresorhus avatar sindresorhus commented on July 24, 2024

Blocked by sindresorhus/trash#24 (Which is a long standing macOS bug...)

from trash-cli.

zaaack avatar zaaack commented on July 24, 2024

@sindresorhus What a pity..

from trash-cli.

zaaack avatar zaaack commented on July 24, 2024

@sindresorhus Can we store the original file's directory and just mv ~/.Trash/<lastFile> <lastDirectory>? I tried and it looks totally feasible.

from trash-cli.

sindresorhus avatar sindresorhus commented on July 24, 2024

No, macOS renames duplicates in the trash, so original filenames are not guaranteed. The only workaround, as discussed in the original issue, is to parse the undocumented .DS_Store file, but that's not something I have time or interest in doing.

from trash-cli.

zaaack avatar zaaack commented on July 24, 2024

@sindresorhus We can rename duplicates manually before putting to trash.

from trash-cli.

sindresorhus avatar sindresorhus commented on July 24, 2024

That's a slippery slope. And our mapping will easily get out of sync when the user trashes and restores in Finder, which we can't know about.

from trash-cli.

zaaack avatar zaaack commented on July 24, 2024

@sindresorhus But this wouldn't be a huge problem? We can rename with timestamp and rand id each time before moving to Trash, if the user restores in Finder, then it's handled by the user, he or she will know what he or she is doing since he is already using the command line. And if we cannot find the renamed file in Trash, we can print some message to show what happened.

from trash-cli.

sindresorhus avatar sindresorhus commented on July 24, 2024

Yes, I guess that would work, but it's not something I would be interested in maintaining.

from trash-cli.

zaaack avatar zaaack commented on July 24, 2024

@sindresorhus Fair enough.

from trash-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.