From 36a3c2f20f3b240e188885c208c63172ea2cffe0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 5 Jun 2018 15:10:06 -0400 Subject: [PATCH] core: move `Int::isatty` to `file` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/core/file.nit | 3 +++ lib/core/posix.nit | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/core/file.nit b/lib/core/file.nit index 26f7398..261dc7d 100644 --- a/lib/core/file.nit +++ b/lib/core/file.nit @@ -306,6 +306,9 @@ redef class Int private fun fd_to_stream(mode: CString): NativeFile `{ return fdopen((int)self, mode); `} + + # Does the file descriptor `self` refer to a terminal? + fun isatty: Bool `{ return isatty(self); `} end # Constant for read-only file streams diff --git a/lib/core/posix.nit b/lib/core/posix.nit index 587e606..2969830 100644 --- a/lib/core/posix.nit +++ b/lib/core/posix.nit @@ -111,8 +111,3 @@ extern class Group `{struct group*`} return ret; `} end - -redef class Int - # Does the file descriptor `self` refer to a terminal? - fun isatty: Bool `{ return isatty(self); `} -end -- 1.7.9.5