Linux.com

Fraserb82

Fraserb82

  • Linux.com Member
  • Posts: 1
  • Member Since: 21 Oct 13
  • Last Logged In: 21 Oct 13

Latest Posts

Posted by
Topic
Post Preview
Posted
  • Fraserb82
    Two files, same name, same directory
    Hi, Really hoping someone can help. For a Uni project I need to create a trash can for Linux, much like the Windows one. Files are not deleted, just put in a trash can for safety purposes in case they deleted by mistake. Anyway, I know you cant have two files with the same name in the same directory. Which is causing me bother with the mv command I am using to put files in the trash can, as it just overwrites the file that is there. Is there a way to do this, perhaps hidden text on the filename or something like that? I was messing about with adding the date to the name when it was moved, but I am not sure how to remove that date when the file is restored back to its original location. Any help would be great.
    Link to this post 21 Oct 13

    Hi,

    Really hoping someone can help.

    For a Uni project I need to create a trash can for Linux, much like the Windows one. Files are not deleted, just put in a trash can for safety purposes in case they deleted by mistake.

    Anyway, I know you cant have two files with the same name in the same directory. Which is causing me bother with the mv command I am using to put files in the trash can, as it just overwrites the file that is there.

    Is there a way to do this, perhaps hidden text on the filename or something like that? I was messing about with adding the date to the name when it was moved, but I am not sure how to remove that date when the file is restored back to its original location.

    Any help would be great.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board