BaH.Volumes - Update

BlitzMax Forums/Brucey's Modules/BaH.Volumes - Update

Brucey(Posted 2011) [#1]
BaH.Volumes is a small cross-platform module which provides useful volume/device information support for BlitzMax, using a common API.

A new version (1.07) is now available.

This contains the following improvements :
* Added support for all native CSIDL paths on Win32 using GetCustomDir.
* Added support for 'k' paths on Mac using GetCustomDir.
* Updated documentation.


BaH.Volumes is available for download from the Maxmods GoogleCode site, as are most of my modules.

Enjoy :o)


xlsior(Posted 2011) [#2]
Cool, thanks


Space_guy(Posted 2011) [#3]
Cool. It might be useful


Difference(Posted 2011) [#4]
Thanks, this will be handy.


siread(Posted 2011) [#5]
Hi Brucey, I cannot seem to locate the Recycle Bin with GetCustomDir...

Const CSIDL_DESKTOP                 = $0000  ' <desktop>
Const CSIDL_BITBUCKET               = $000a  ' <desktop>\Recycle Bin


CSIDL_DESKTOP works fine but CSIDL_BITBUCKET returns blank on Win32 (I'm on Win7). Any idea? No biggie but I'd like to be able to move files to trash rather than deletefile().

Also, I can't find any info on these 'k paths' you mention. Do you know what the mac equivalent is or where I can find a list of k-paths?


Brucey(Posted 2011) [#6]
Vista deprecates CSIDL, apparently... cool :-)

I have a workaround, which uses the new API... just need to see how to implement it and yet remain compatible with the rest (if that's possible!)

There's a long list of k-paths in the current source (vol_mac.bmx), that you can use. I think that has most of them.


Brucey(Posted 2011) [#7]
I've checked in new support for FOLDERIDs. On systems that support it (vista, win7, etc) it should transparently use the matching FOLDERID value for the passed CSIDL, calling the new API instead.

But funnily enough, I can't get FOLDERID_RecycleBinFolder to return anything, while all the others appear to be working as expected!! :-/

I think it may be because it is a virtual folder, and I may need to go in through IKnownFolderManager::GetFolder to find a real path instead... this may be true for all the virtual folders.


Brucey(Posted 2011) [#8]
After further investigation, virtual folders simply don't exist. That's why it returns nothing.
So you don't have direct access to a path for virtual folders :)

However, it is possible to delete a file using SHFileOperation, and have it go into the recycle bin rather than being deleted permanently, but this functionality is outside the scope of my module.


xlsior(Posted 2011) [#9]
You need to use the API to throw a deleted file at the recycle bin -- Simply moving a file to the recylcebin folder (if you knew the location) wouldn't be sufficient since it wouldn't know the original location necessary to restore a file if you changed your mind.


Brucey(Posted 2011) [#10]
That too :-)