lib/file: Add comments in FileStat
authorJohann Dubois <johann.dubois@outlook.com>
Wed, 29 Jan 2014 19:49:31 +0000 (14:49 -0500)
committerJean Privat <jean@pryen.org>
Fri, 21 Mar 2014 17:20:22 +0000 (13:20 -0400)
closes #234
signed-off-by: Johann Dubois <johann.dubois@outlook.com>

lib/standard/file.nit

index 9114ff1..561df93 100644 (file)
@@ -362,20 +362,32 @@ redef class NativeString
        private fun file_chdir is extern "string_NativeString_NativeString_file_chdir_0"
 end
 
-extern FileStat `{ struct stat * `}
 # This class is system dependent ... must reify the vfs
+extern class FileStat `{ struct stat * `}
+       # Returns the permission bits of file
        fun mode: Int is extern "file_FileStat_FileStat_mode_0"
+       # Returns the last access time
        fun atime: Int is extern "file_FileStat_FileStat_atime_0"
+       # Returns the last status change time 
        fun ctime: Int is extern "file_FileStat_FileStat_ctime_0"
+       # Returns the last modification time
        fun mtime: Int is extern "file_FileStat_FileStat_mtime_0"
+       # Returns the size
        fun size: Int is extern "file_FileStat_FileStat_size_0"
 
+       # Returns true if it is a regular file (not a device file, pipe, sockect, ...)
        fun is_reg: Bool `{ return S_ISREG(recv->st_mode); `}
+       # Returns true if it is a directory
        fun is_dir: Bool `{ return S_ISDIR(recv->st_mode); `}
+       # Returns true if it is a character device
        fun is_chr: Bool `{ return S_ISCHR(recv->st_mode); `}
+       # Returns true if it is a block device
        fun is_blk: Bool `{ return S_ISBLK(recv->st_mode); `}
+       # Returns true if the type is fifo
        fun is_fifo: Bool `{ return S_ISFIFO(recv->st_mode); `}
+       # Returns true if the type is a link
        fun is_lnk: Bool `{ return S_ISLNK(recv->st_mode); `}
+       # Returns true if the type is a socket
        fun is_sock: Bool `{ return S_ISSOCK(recv->st_mode); `}
 end