[OpendTect_Developers] namespace File

Nanne Hemstra nanne.hemstra at dgbes.com
Mon Feb 13 07:22:11 CET 2012


Dear all,

In the source code of OpendTect you'll find the File namespace
($WORK/include/Basic/file.h). Within this namespace we have developed a
bunch of very handy static functions, related to (how surprisingly) files.
As you probably know, file handling is quite different on each OS, and
luckily Qt has implemented a cross-platform solution for this. Our File
functions can be seen as an isolating layer on top of Qt's services.

To give a few examples of what to expect here. You can check for a file's
existence using File::exists(), and remove a file using File::remove().
There are also a couple of directory related functions, so to know if a
path is a directory, you can call File::isDirectory(), create a directory
with File::createDir(), or if you want to copy one File::copyDir().

The File namespace also has a few 'information' functions. You can get
permission information using File::isWritable(), the file size from
File::getFileSize(), and the last modification time from
File::timeLastModified(). To know how much disk space is left, use
File::getKbSize().

There's more, so please have a look in file.h, to see what's available.

Best regards,
Nanne


-- 
Nanne Hemstra
Executive Vice President - Americas

dGB Earth Sciences
1, Sugar Creek Center Blvd - Suite 935
Sugar Land, TX 77478 - USA
Phone: +1 281-240-3939, Fax: +1 281-240-3944
http://www.dgbes.com , http://www.opendtect.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20120213/2ae19700/attachment.html>


More information about the Developers mailing list