[Insight-developers] Portable File System information?

Kent Williams kent@mail.psychiatry.uiowa.edu
Wed, 5 Mar 2003 09:23:54 -0600


In the code I'm working on I need to know a few things about a file:

Is it a directory?
How large is it?
Is it readable?
Is it writeable?

The code I'm porting just calls stat to find out these things; I suspect =
this=20
will work across Posix systems (including Microsoft Visual Studio) but I'=
m=20
scared of Borland C. =20

Do we need something like

class FileInfo {
public:
=09FileInfo(const char *FileName);
=09bool IsDir();
=09bool IsReadable();
=09bool IsWritable();
=09FileSizeT Size();
=09const char *RealPath();
};