Merge branch 'doc_for_FileStat'
authorJean Privat <jean@pryen.org>
Fri, 21 Mar 2014 17:21:05 +0000 (13:21 -0400)
committerJean Privat <jean@pryen.org>
Fri, 21 Mar 2014 17:21:05 +0000 (13:21 -0400)
1  2 
lib/standard/file.nit

@@@ -444,23 -360,34 +444,35 @@@ redef class NativeStrin
        private fun file_mkdir: Bool is extern "string_NativeString_NativeString_file_mkdir_0"
        private fun file_delete: Bool is extern "string_NativeString_NativeString_file_delete_0"
        private fun file_chdir is extern "string_NativeString_NativeString_file_chdir_0"
 +      private fun file_realpath: NativeString is extern "file_NativeString_realpath"
  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