BaH.FileSystemEx

BlitzMax Forums/Brucey's Modules/BaH.FileSystemEx

Brucey(Posted 2011) [#1]
This is designed as a replacement for BRL.Filesystem, using Boost's filesystem framework to provide nice cross-platform file handling with large file support.

Note that without changes to TStream, streaming file access is still limited to 32-bit file sizes, but file copy is now not limited to 32-bit files.
It should also be unicode friendly, although I've not thrashed it too much in my limited tests so far.

The provided examples compare output between BRL and BaH modules - they should always match.

I've still to implement the ReadDir(), NextFile(), CloseDir() functionality...

Please let me know if it throws any exceptions - there's an option for it not to, but I may have missed one or two calls.

Available from SVN in the usual place...
Also requires the latest Boost module (also in SVN).


Brucey(Posted 2011) [#2]
All the functions appear to give matching results (compared to BRL.Filesystem), except for ReadDir(), which doesn't return "." or ".." in the list of files acquired. (this is by design in Boost, apparently).


As for the TStream <= 32-bit issue... there's not much to be done without rewriting it all to use Long instead. I'm not going there!
The other option is to have a Long stream which mirrors all the functionality of TStream (including ramstream, httpstream, etc).

This is doable but how useful is it? Who wants to read > 2gig files with TStream?


Difference(Posted 2011) [#3]
excellent, looking forward to trying it out.


Grisu(Posted 2011) [#4]
Sounds interesting.

Are commands such as LoadDir() any faster with your module?

Last edited 2011


Brucey(Posted 2011) [#5]
Faster? I've no idea.
Is the original slow?


Grisu(Posted 2011) [#6]
I have to read a lot files (1000+) from a dir.
So every ms helps, especially when using an USB Stick as storage device.

I'm always after optimisations.


MacSven(Posted 2011) [#7]
Problem with my Backup Application and bah.FilesystemEX CopyFile.
How can i Solve it:

terminate called after throwing an instance of 'boost::filesystem3::filesystem_error'
what(): boost::filesystem::directory_iterator::construct: Permission denied: "/Library/Application Support/Apple/ParentalControls/Users"

Or can i check before i am copy this file if i have the permission?