Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Shortcuts don't appear using DirectoryInfo.GetFiles () !

Discussion in 'Scripting' started by AdhamT, Feb 6, 2016.

  1. AdhamT

    AdhamT

    Joined:
    Mar 29, 2015
    Posts:
    19
    Hi, Guys !

    I am using DirectoryInfo.GetFiles () to get all the files in a specific directory (Desktop) but it doesn't return shortcuts and standards like recycle bin ...

    Any ideas on what's happening here ?

    Also, I want to exclude some types of files from DirectoryInfo.GetFiles, how can I do it ?
    Can I exclude all hidden and system files ?

    Thanks in Advance
     
  2. Teravisor

    Teravisor

    Joined:
    Dec 29, 2014
    Posts:
    654
    Recycle bin isn't a shortcut. Computer and Networks aren't shortcuts either. You should see windows C# specifics for how to access them.

    Check each file's parameters and remove them from list you got.
     
  3. AdhamT

    AdhamT

    Joined:
    Mar 29, 2015
    Posts:
    19

    OK, I got the excluding part.

    I know that recycle bin isn't a shortcut and if you read what I wrote, I said "it doesn't return shortcuts and standards like recycle bin". I didn't say that recycle bin is a shortcut, I said that it doesn't return shortcuts AND recycle bin.
     
  4. Teravisor

    Teravisor

    Joined:
    Dec 29, 2014
    Posts:
    654
  5. AdhamT

    AdhamT

    Joined:
    Mar 29, 2015
    Posts:
    19
  6. AdhamT

    AdhamT

    Joined:
    Mar 29, 2015
    Posts:
    19
  7. AdhamT

    AdhamT

    Joined:
    Mar 29, 2015
    Posts:
    19
    Now, I want to getfiles from two directories and return them in the same time.

    For example : FileInfo[] Files = GetFiles (Directory1, Directory2);
     
  8. Teravisor

    Teravisor

    Joined:
    Dec 29, 2014
    Posts:
    654