Hello all, I was browsing boost to find some portable means for getting file system statistics such as file system (disk) size, free space, etc. I kind of expected to see this in the boost filesystem library, but they don't appear to be there. Doesn't even seem to be in the "Do-list". Am I missing something? Looking in the wrong place? Thanks, Steve
On 6/21/05, Steve Hartmann
Hello all,
I was browsing boost to find some portable means for getting file system statistics such as file system (disk) size, free space, etc. I kind of expected to see this in the boost filesystem library, but they don't appear to be there. Doesn't even seem to be in the "Do-list".
Am I missing something? Looking in the wrong place?
I've got an implementation (independent of FileSystem) that works on windows, hp and linux (others I'm sure, but I don't use them) if anyone's interested.
I am, thanks in advance ! If this implementation is not deemed to go with Boost, why not a new project on Sourceforge ? I may try to port it to Solaris, if you wish to. Thomas Matelich wrote:
On 6/21/05, Steve Hartmann
wrote: Hello all,
I was browsing boost to find some portable means for getting file system statistics such as file system (disk) size, free space, etc. I kind of expected to see this in the boost filesystem library, but they don't appear to be there. Doesn't even seem to be in the "Do-list".
Am I missing something? Looking in the wrong place?
I've got an implementation (independent of FileSystem) that works on windows, hp and linux (others I'm sure, but I don't use them) if anyone's interested.
On 6/21/05, remi.chateauneu@gmx.de
I am, thanks in advance ! If this implementation is not deemed to go with Boost, why not a new project on Sourceforge ? I may try to port it to Solaris, if you wish to.
Thomas Matelich wrote:
On 6/21/05, Steve Hartmann
wrote: Hello all,
I was browsing boost to find some portable means for getting file system statistics such as file system (disk) size, free space, etc. I kind of expected to see this in the boost filesystem library, but they don't appear to be there. Doesn't even seem to be in the "Do-list".
Am I missing something? Looking in the wrong place?
I've got an implementation (independent of FileSystem) that works on windows, hp and linux (others I'm sure, but I don't use them) if anyone's interested.
Its really not that complicated. just a wrapper around statfs on unix
and GetDiskFreeSpaceEx on windows. Its not terribly long, I'll post
it (copied from a longer .cpp file, sorry if I miss an include).
#ifndef _WIN32
#include
"Thomas Matelich"
On 6/21/05, remi.chateauneu@gmx.de
wrote:
I've got an implementation (independent of FileSystem) that works on windows, hp and linux (others I'm sure, but I don't use them) if anyone's interested.
Its really not that complicated. just a wrapper around statfs on unix and GetDiskFreeSpaceEx on windows.
Probably a dumb question, but why did you use
On 6/22/05, Beman Dawes
"Thomas Matelich"
wrote in message news:3944d45805062113231fa767ff@mail.gmail.com... Probably a dumb question, but why did you use
and statfs() instead of the POSIX and statvfs()? Were they not present on some of the target systems? I would like to include the functionality in Boost.Filesystem, but am concerned because POSIX lists it as optional.
I started with our legacy HP implementation as a reference and didn't need to change it for linux, so I didn't even notice that there was a different header. :-) I'd be fairly surprised if a platform supported by Filesystem didn't have a way to determine disk space. Well, I guess not all that surprised. Murphy's always waitin'.
"Thomas Matelich"
On 6/22/05, Beman Dawes
wrote: "Thomas Matelich"
wrote in message news:3944d45805062113231fa767ff@mail.gmail.com... Probably a dumb question, but why did you use
and statfs() instead of the POSIX and statvfs()? Were they not present on some of the target systems? I would like to include the functionality in Boost.Filesystem, but am concerned because POSIX lists it as optional.
I started with our legacy HP implementation as a reference and didn't need to change it for linux, so I didn't even notice that there was a different header. :-)
I'd be fairly surprised if a platform supported by Filesystem didn't have a way to determine disk space. Well, I guess not all that surprised. Murphy's always waitin'.
"Thomas Matelich"
On 6/22/05, Beman Dawes
wrote: "Thomas Matelich"
wrote in message news:3944d45805062113231fa767ff@mail.gmail.com... Probably a dumb question, but why did you use
and statfs() instead of the POSIX and statvfs()? Were they not present on some of the target systems? I would like to include the functionality in Boost.Filesystem, but am concerned because POSIX lists it as optional.
I started with our legacy HP implementation as a reference and didn't need to change it for linux, so I didn't even notice that there was a different header. :-)
Understood. Does the legacy HP implementation also supply
I'd be fairly surprised if a platform supported by Filesystem didn't have a way to determine disk space. Well, I guess not all that surprised. Murphy's always waitin'.
Yep. But that isn't necessarily a showstopper. 1.34 will add a function to create hard links, and just document the fact that it will always fail on some file systems. To me the key platforms are POSIX/Windows/Linux/Solaris/MacOS/HPux/AIX. If we get uniform behavior across those platforms, it is OK if a function can't succeed on more obscure platforms. --Beman
On 6/22/05, Beman Dawes
"Thomas Matelich"
wrote in message news:3944d45805062213536c52a507@mail.gmail.com... On 6/22/05, Beman Dawes
wrote: "Thomas Matelich"
wrote in message news:3944d45805062113231fa767ff@mail.gmail.com... Probably a dumb question, but why did you use
and statfs() instead of the POSIX and statvfs()? Were they not present on some of the target systems? I would like to include the functionality in Boost.Filesystem, but am concerned because POSIX lists it as optional.
I started with our legacy HP implementation as a reference and didn't need to change it for linux, so I didn't even notice that there was a different header. :-)
Understood. Does the legacy HP implementation also supply
and statvfs()?
I slapped myself as soon as I saw the question, should have included that info in my first response. Yes, HP does have that.
On Wed, 2005-06-22 at 13:35 -0400, Beman Dawes wrote:
"Thomas Matelich"
wrote in message news:3944d45805062113231fa767ff@mail.gmail.com... On 6/21/05, remi.chateauneu@gmx.de
wrote: I've got an implementation (independent of FileSystem) that works on windows, hp and linux (others I'm sure, but I don't use them) if anyone's interested.
Its really not that complicated. just a wrapper around statfs on unix and GetDiskFreeSpaceEx on windows.
Probably a dumb question, but why did you use
and statfs() instead of the POSIX and statvfs()? Were they not present on some of the target systems?
Note that some systems do not have statvfs. This is the case of, for example, NetBSD until 2.1, which only had statfs (sys/param.h and sys/mount.h required for it to work).
From statvfs' manpage:
HISTORY
The statvfs(), statvfs1(), fstatvfs(), and fstatvfs1() functions
first
appeared in NetBSD 2.1 to replace the statfs() family of functions
which
first appeared in 4.4BSD.
--
Julio M. Merino Vidal
"Steve Hartmann"
Hello all,
I was browsing boost to find some portable means for getting file system statistics such as file system (disk) size, free space, etc. I kind of expected to see this in the boost filesystem library, but they don't appear to be there. Doesn't even seem to be in the "Do-list".
I've added it to the "do-list":-) --Beman
participants (5)
-
Beman Dawes
-
Julio M. Merino Vidal
-
remi.chateauneu@gmx.de
-
Steve Hartmann
-
Thomas Matelich