Search Unity

Accessing the recycle bin without switching to UWP

Discussion in 'Windows' started by malkere, Jan 10, 2018.

  1. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I'm trying to find a way to send files to the recycle bin instead of out right deleting them. I can see in the documentation that UnityEngine.Windows.Directory does exist, and it is suggested that it will send to the recycle bin by default as opposed to System.IO.Directory which does not. However the assembly is only present with UWP targeted builds.

    Is there anyway to access the Windows.Directory assembly targeting Linux, Mac, PC?

    Are there downsides to publishing for UWP when you have no intention of posting to the Windows Store? I am posting to Steam, my game is NOT mobile capable, and I can certainly still post the generic build for Linux and Mac users.

    I really just want to access the recycle bin =3
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
  3. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    IntPtr and [Flags] work just fine here. Did you forget "using System;" at the top of your source file? I don't understand why you started referencing Microsoft.VisualBasic.FileIO.FileSystem - that thing is nowhere in the post I linked.
     
  5. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    It's the third answer to the question your posted.
    I was trying a lot of things I may have just missed the System reference, I will try it again, thanks!

    I just released early access on Steam though so gimme a few days =D
     
  6. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Working great =D Thank you for the follow-up Tautvydas-Zilys