andrewhayden / folderslice

Automatically exported from code.google.com/p/folderslice
0 stars 0 forks source link

Gadget ignores recycle bin #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Drag a reasonably-large folder onto the gadget and observe the
percentage of the drive that the folder takes up
2. Delete large items from the recycle bin
3. Refresh and/or drag the folder to the gadget again and observe that the
percentage of the drive that the folder takes up has changed
4. Attempt to drag the recycle bin to the gadget.  Note that 0 files are
processed.

What is the expected output? What do you see instead?
The gadget should process items in the recycle bin.  These items are
reported in the "used space" of the drive, but are currently unreachable in
the gadget.  This leads to weird results, like C: being shown to take up
only a percentage of its own space.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by andrew.h...@gmail.com on 15 Jun 2007 at 10:31

GoogleCodeExporter commented 9 years ago
The Gadget should use the System.Shell.RecycleBin object to handle the special 
case
of recycler folders.  There appears to be sufficient information to do this 
quickly
and easily, without needing to traverse any of the actual files in the bin
(accessible properties include size as well as file count).  API documentation 
can be
found here:

https://msdn2.microsoft.com/en-us/library/ms723187.aspx

Original comment by andrew.h...@gmail.com on 15 Jun 2007 at 10:36

GoogleCodeExporter commented 9 years ago
Researching this has proven problematic.  It is apparently not possible at the 
moment
to retrieve the path to the Recycle Bin using the javascript language bindings; 
any
attempt to do so throws "Object error" at runtime.  Other well-known locations 
are
amenable to System.Shell.knownFolder and System.Shell.knownFolderPath.

In the absence of knowing on which drive the recycle bin lives and where, it 
seems
difficult to accurately solve this problem; it is ambiguous what happens when 
there
are multiple drives (since System.Shell.RecycleBin is a singleton), and I can't 
seem
to traverse the recycle bin itself.  This bug may persist for a bit, until I 
find (or
someone can suggest) a good workaround.

Original comment by andrew.h...@gmail.com on 15 Jun 2007 at 9:30

GoogleCodeExporter commented 9 years ago
After a few days of research, it appears this problem is currently intractable 
in
Javascript.  As a workaround, added a note to the details flyout stating that 
files
and folders in the recycle bin are not included in analysis.

Mitigated in revision 86.

Original comment by andrew.h...@gmail.com on 19 Jun 2007 at 12:41

GoogleCodeExporter commented 9 years ago

Original comment by andrew.h...@gmail.com on 19 Jun 2007 at 1:02

GoogleCodeExporter commented 9 years ago

Original comment by andrew.h...@gmail.com on 19 Jun 2007 at 2:18

GoogleCodeExporter commented 9 years ago
There are a few other approaches that might give you some joy (if only as a 
substitute to the broken functionality you've already beaten on):
- system.environment.getfolderpath()
- p/invoke to Shell32's GetFolder() API using the constant 
FOLDERID_RecycleBinFolder 
(http://msdn2.microsoft.com/en-us/library/ms645244.aspx)
- [I believe there's some method as part of the system.management namespace as 
well 
that can retrieve 'special folders', but I can't find it]

As a last resort, you could try a p/invoke to SHGetFolderPath and leverage the 
CSIDL 
constant CSIDL_BITBUCKET 
(http://msdn2.microsoft.com/en-us/library/ms649274.aspx)

Original comment by mikesmit...@gmail.com on 28 Jun 2007 at 5:14

GoogleCodeExporter commented 9 years ago
Mike,

Thanks for the links.  I've added this info to Issue #5, which is still open to 
track
this.

Original comment by andrew.h...@gmail.com on 28 Jun 2007 at 12:09