Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:
indexing description: "Internal file information" status: "See notice at end of class" date: "$Date: 2001-11-16 20:32:23 +0000 (Fri, 16 Nov 2001) $" revision: "$Revision: 51435 $" class UNIX_FILE_INFO create make feature -- Initialization make is -- Creation procedure do make_buffered_file_info (stat_size) end feature {NONE} -- Initialization make_buffered_file_info (n: INTEGER) is -- Creates a special object for n entries. -- (from TO_SPECIAL) require -- from TO_SPECIAL non_negative_argument: n >= 0 do create buffered_file_info.make (n) ensure -- from TO_SPECIAL area_allocated: buffered_file_info /= void and then buffered_file_info.count = n end feature -- Access access_date: INTEGER is -- Date of last access do Result := file_info ($buffered_file_info, 8) end buffered_file_info: SPECIAL [CHARACTER] -- Special data zone -- (from TO_SPECIAL) change_date: INTEGER is -- Date of last status change do Result := file_info ($buffered_file_info, 9) end date: INTEGER is -- Last modification date do Result := file_info ($buffered_file_info, 7) end device: INTEGER is -- Device number on which inode resides do Result := file_info ($buffered_file_info, 2) end device_type: INTEGER is -- Device type on which inode resides do Result := file_info ($buffered_file_info, 3) end file_name: STRING -- File name to which information applies. group_id: INTEGER is -- GID of the file do Result := file_info ($buffered_file_info, 5) end group_name: STRING is -- Name of the file group, if available from /etc/group. -- Otherwise, the GID do Result := file_group (group_id) end inode: INTEGER is -- Inode number do Result := file_info ($buffered_file_info, 1) end links: INTEGER is -- Number of links do Result := file_info ($buffered_file_info, 10) end owner_name: STRING is -- Name of the file owner, if available from /etc/passwd. -- Otherwise, the UID do Result := file_owner (user_id) end protection: INTEGER is -- Protection mode of file (12 lower bits) do Result := file_info ($buffered_file_info, 0) end size: INTEGER is -- File size, in bytes do Result := file_info ($buffered_file_info, 6) end type: INTEGER is -- File type (4 bits, 12 lowest bits zeroed) do Result := file_info ($buffered_file_info, 11) end user_id: INTEGER is -- UID of the file owner do Result := file_info ($buffered_file_info, 4) end feature -- Status report is_access_executable: BOOLEAN is -- Is file executable by real UID? local ext_name: ANY do ext_name := file_name.to_c Result := file_access ($ext_name, 1) end is_access_owner: BOOLEAN is -- Is file owned by real UID? do Result := file_eaccess ($buffered_file_info, 7) end is_access_readable: BOOLEAN is -- Is file readable by real UID? local ext_name: ANY do ext_name := file_name.to_c Result := file_access ($ext_name, 3) end is_access_writable: BOOLEAN is -- Is file writable by real UID? local ext_name: ANY do ext_name := file_name.to_c Result := file_access ($ext_name, 2) end is_block: BOOLEAN is -- Is file a device block special file? do Result := file_info ($buffered_file_info, 16) /= 0 end is_character: BOOLEAN is -- Is file a character block special file? do Result := file_info ($buffered_file_info, 15) /= 0 end is_device: BOOLEAN is -- Is file a device? do Result := file_info ($buffered_file_info, 14) /= 0 end is_directory: BOOLEAN is -- Is file a directory? do Result := file_info ($buffered_file_info, 12) /= 0 end is_executable: BOOLEAN is -- Is file executable by effective UID? do Result := file_eaccess ($buffered_file_info, 2) end is_fifo: BOOLEAN is -- Is file a named pipe? do Result := file_info ($buffered_file_info, 17) /= 0 end is_owner: BOOLEAN is -- Is file owned by effective UID? do Result := file_eaccess ($buffered_file_info, 6) end is_plain: BOOLEAN is -- Is file a plain file? do Result := file_info ($buffered_file_info, 13) /= 0 end is_readable: BOOLEAN is -- Is file readable by effective UID? do Result := file_eaccess ($buffered_file_info, 0) end is_setgid: BOOLEAN is -- Is file setgid? do Result := file_eaccess ($buffered_file_info, 4) end is_setuid: BOOLEAN is -- Is file setuid? do Result := file_eaccess ($buffered_file_info, 3) end is_socket: BOOLEAN is -- Is file a named socket? do Result := file_info ($buffered_file_info, 19) /= 0 end is_sticky: BOOLEAN is -- Is file sticky? do Result := file_eaccess ($buffered_file_info, 5) end is_symlink: BOOLEAN is -- Is file a symbolic link? do Result := file_info ($buffered_file_info, 18) /= 0 end is_writable: BOOLEAN is -- Is file writable by effective UID? do Result := file_eaccess ($buffered_file_info, 1) end feature -- Element change update (f_name: STRING) is -- Update information buffer: fill it in with information -- from the inode of f_name. local ext_name: ANY do ext_name := f_name.to_c file_stat ($ext_name, $buffered_file_info) file_name := f_name end feature {NONE} -- Element change set_area (other: like buffered_file_info) is -- Make other the new area -- (from TO_SPECIAL) do buffered_file_info := other end feature {NONE} -- Implementation file_access (f_name: ANY; which: INTEGER): BOOLEAN is -- Perform access test which on f_name using real ID. external "C (char *, EIF_INTEGER): EIF_BOOLEAN | %"eif_file.h%"" end file_eaccess (stat_buf: POINTER; which: INTEGER): BOOLEAN is -- Perform access tests using effective ID. external "C (struct stat *, EIF_INTEGER): EIF_BOOLEAN | %"eif_file.h%"" end file_group (gid: INTEGER): STRING is -- Convert GID to group name if possible external "C | %"eif_file.h%"" end file_info (stat_buf: POINTER; which: INTEGER): INTEGER is -- Extract information which from information buffer external "C (struct stat *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%"" end file_owner (uid: INTEGER): STRING is -- Convert UID to login name if possible external "C | %"eif_file.h%"" end file_stat (name, stat_buf: POINTER) is -- Get information from file name into stat_buf external "C (char *, struct stat *) | %"eif_file.h%"" end stat_size: INTEGER is -- Get size of 'struct stat' (in bytes) external "C | %"eif_file.h%"" end invariant -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) indexing library: "[ EiffelBase: Library of reusable components for Eiffel. ]" status: "[ Copyright 1986-2001 Interactive Software Engineering (ISE). For ISE customers the original versions are an ISE product covered by the ISE Eiffel license and support agreements. ]" license: "[ EiffelBase may now be used by anyone as FREE SOFTWARE to develop any product, public-domain or commercial, without payment to ISE, under the terms of the ISE Free Eiffel Library License (IFELL) at http://eiffel.com/products/base/license.html. ]" source: "[ Interactive Software Engineering Inc. ISE Building 360 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Electronic mail <info@eiffel.com> Customer support http://support.eiffel.com ]" info: "[ For latest info see award-winning pages: http://eiffel.com ]" end -- class UNIX_FILE_INFO
Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com