Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

kernel.io

Class KI_FILE_SYSTEM_ENTRY


Known direct descendants

KI_DIRECTORY, KI_FILE

Features

Invariants

indexing

description

Interface for file system entries (files, directories, ...)

library

Gobo Eiffel Kernel Library

copyright

Copyright (c) 2001, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2004/11/14 15:09:42 $

revision

$Revision: 1.11 $

deferred class

KI_FILE_SYSTEM_ENTRY

feature -- Initialization

reset (a_name: STRING)

-- Reuse current Eiffel object memory to
-- represent a new file system entry.
-- (a_name should follow the pathname convention
-- of the underlying platform. For pathname conversion
-- use KI_FILE_SYSTEM.pathname_from_file_system.)

require
a_name_not_void: a_name /= Void
is_closed: is_closed
ensure
name_set: name = a_name
is_closed: is_closed

feature -- Access

name: STRING

-- File system entry name

ensure
name_not_void: Result /= Void

feature -- Status report

exists: BOOLEAN

-- Does file system entry physically exist on disk?
-- (Note that with SmartEiffel this routine actually
-- returns is_readable.)

is_closable: BOOLEAN

-- Can current file system entry be closed?

ensure
definition: Result = is_open
is_closed: BOOLEAN

-- Is file system entry closed?

ensure
definition: Result = not is_open
is_open: BOOLEAN

-- Has file system entry been opened?

is_readable: BOOLEAN

-- Can file system entry be opened in read mode?

ensure
exists: Result implies exists

feature -- Basic operations

close

-- Try to close file system entry. Set is_closed
-- to true if operation was successful.

require
is_closable: is_closable
delete

-- Delete current file system entry.
-- Do nothing if the entry could not be deleted
-- (for example if the entry does not exist or
-- if a directory is not empty).

require
is_closed: is_closed
open

-- Try to open file system entry. Set is_open
-- to true if operation was successful.

require
is_closed: is_closed

invariant

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end