* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_utility
*/
+#include "gmxpre.h"
+
#include "file.h"
+#include "config.h"
+
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/stringutil.h"
-#include "gmx_header_config.h"
-
namespace gmx
{
}
}
+bool File::isInteractive() const
+{
+ GMX_RELEASE_ASSERT(impl_->fp_ != NULL,
+ "Attempted to access a file object that is not open");
+#ifdef HAVE_UNISTD_H
+ return isatty(fileno(impl_->fp_));
+#else
+ return true;
+#endif
+}
+
FILE *File::handle()
{
GMX_RELEASE_ASSERT(impl_->fp_ != NULL,