core :: FileStream
Stream used to interact with a File or FileDescriptorcore :: FileStream :: defaultinit
core :: FileStream :: file_stat
The status of a file. see POSIX stat(2).core :: FileStream :: set_buffering_mode
Sets the buffering mode for the current FileStreamcore $ FileStream :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class to create the specific class.
			core :: FileStream :: defaultinit
core :: Object :: defaultinit
core :: Stream :: defaultinit
core :: FileStream :: file_stat
The status of a file. see POSIX stat(2).core :: Object :: is_same_instance
Return true ifself and other are the same instance (i.e. same identity).
			core :: Object :: is_same_serialized
Isself the same as other in a serialization context?
			core :: Object :: is_same_type
Return true ifself and other have the same dynamic type.
			core :: Stream :: last_error=
Error produced by the file streamcore :: Stream :: lookahead=
Lookahead buffer for codecscore :: Stream :: lookahead_capacity
Capacity of the lookaheadcore :: Stream :: lookahead_capacity=
Capacity of the lookaheadcore :: Stream :: lookahead_length
Current occupation of the lookaheadcore :: Stream :: lookahead_length=
Current occupation of the lookaheadcore :: Object :: output_class_name
Display class name on stdout (debug only).core :: FileStream :: set_buffering_mode
Sets the buffering mode for the current FileStreamcore :: Stream :: write_buffer
Buffer for writing data to a streamcore :: Stream :: write_buffer=
Buffer for writing data to a stream
# `Stream` used to interact with a File or FileDescriptor
abstract class FileStream
	super Stream
	# The path of the file.
	var path: nullable String = null
	# The FILE *.
	private var file: nullable NativeFile = null
	# The status of a file. see POSIX stat(2).
	#
	#     var f = new FileReader.open("/etc/issue")
	#     assert f.file_stat.is_file
	#
	# Return null in case of error
	fun file_stat: nullable FileStat
	do
		var stat = _file.as(not null).file_stat
		if stat.address_is_null then return null
		return new FileStat(stat)
	end
	# File descriptor of this file
	fun fd: Int do return _file.as(not null).fileno
	redef fun close
	do
		var file = _file
		if file == null then return
		if file.address_is_null then
			if last_error != null then return
			last_error = new IOError("Cannot close unopened file")
			return
		end
		var i = file.io_close
		if i != 0 then
			last_error = new IOError("Close failed due to error {sys.errno.strerror}")
		end
		_file = null
	end
	# Sets the buffering mode for the current FileStream
	#
	# If the buf_size is <= 0, its value will be 512 by default
	#
	# The mode is any of the buffer_mode enumeration in `Sys`:
	#
	# * `buffer_mode_full`
	# * `buffer_mode_line`
	# * `buffer_mode_none`
	fun set_buffering_mode(buf_size, mode: Int) do
		if buf_size <= 0 then buf_size = 512
		if _file.as(not null).set_buffering_type(buf_size, mode) != 0 then
			last_error = new IOError("Error while changing buffering type for FileStream, returned error {sys.errno.strerror}")
		end
	end
end
					lib/core/file.nit:43,1--99,3