• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

file.listFiles() returns extra folders compared to Windows Explorer (Windows 7)

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
File method listFiles() returns a list of files and folders, but the folders include some not shown by Windows Explorer. The extra folders all claim to be empty so are no use. Is there any way to filter out those not shown by WE to make the user experience more consistent? (I thought canonicalisation might resolve them but it doesn't.)

For C://, these are the additional ones:
  • $Recycle.Bin - fair enough, though the contents are "repackaged"
  • Config.Msi
  • Documents and Settings
  • Recovery
  • System Volume Information

  • C:\\Users has:
  • Default User

  • and my user has:
  • Application Data
  • Cookies
  • Local Settings
  • NetHood
  • PrintHood
  • Recent
  • SendTo
  • Start Menu
  • Templates
  •  
    Rancher
    Posts: 1044
    6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    They seem to be special purpose folders, handled by the explorer specially.

    They might be listed in the registry. As if their names were even translated to the local language in a non-English Windows.
    WE can be (and by default is) set to hide the known file extensions.

    It could be a hard task to provide a completely consistent experience...
     
    Bartender
    Posts: 3323
    86
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I suspect these folders all have their hidden flag set, so you could test for that and filter out all hidden folders.
     
    Malcolm Storey
    Ranch Hand
    Posts: 46
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You're right, but it's not what Windows calls "hidden files, folders and drives", which I already had set to "show". If I turn off "Hide protected operating system files (Recommended)" then WE shows them. Some are access-denied, some are merely shortcuts, but it makes more sense now.

    Presumably isHidden() will pick up those that are simply marked as hidden, as well as system folders.

    Many thanks!
     
    reply
      Bookmark Topic Watch Topic
    • New Topic