Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And if you have two files with the same name...


This made me curious about what macOS does. Using the finder, whether via menu command or drag and drop will rename the file automatically to ${filename} hh.mm.ss.${ext}

But mv does not. Interestingly, it doesn’t appear Apple has added their own cli tool for moving something to the trash in the same way that they provide `open` or `pbcopy` or `pbpaste`

You could execute inline AppleScript to tell the Finder to move the file to the trash, but that’s pretty roundabout


I haven't tested it, but this tool probably handles name collisions in .Trash gracefully:

https://github.com/ali-rantakari/trash




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: