pending file primitives (EH?)
Jan Bottorff
janb at pmatrix.com
Sun May 27 19:37:49 UTC 2001
>Since I'm fiddling with file primitives I'd better ask.
>
>Are we missing something at the primitive layer? At this point we should
>be able to open, close, read, write, seek, truncate, and flush. Soooo what
>have we forgotten?
These tend to be pretty platform specific in details but the following are
pretty important at times and some could have platform independent interfaces:
1) issue IOCTL's, many device files need you to use these for a range of
stuff, with very platform specific data formats
2) seek to 64-bit offset's, many OS's support this and things like video
files often need bigger than 32-bits of offset
3) query file/filesystem characteristics, for example on the Windows
platform, you have to ask the filesystem that contains a specific filename
if it's case sensitive as different filesystems vary
4) validation of filenames is also dependent on the filesystem, so should
be handled by a component that get's it right, generally a filesystem API
5) your list didn't include locking, both byte ranges and total file
sharing control like read-only, exclusive access, shared read-write
6) cancel a read/write, many OS's allow you to cancel the I/O on say a
device file which has stopped talking to you, this assumes I/O doesn't
block the whole process
7) controlling buffering, on many platforms unbuffered I/O has dramatically
different performance characteristics than normal buffered I/O, it also
often has requirements like read/write in only disk sector size blocks
8) physical media control, like eject media, load media, lock/unlock media
are especially important for device files
9) dynamic device detection, a number of OS's allow hardware to dynamically
show up and disappear, for example flash meda cards or USB disk drives,
informing an application the device configuration has changed is often
pretty important to get the UI to work as expected
10) query/set arbitrary attributes with name value pair, normal attributes
are things like modification date, but many OS's have attributes like file
creator, or security attributes/backup status/compression/encryption, one
could also view the normal data as just a really big attribute, so perhaps
the open call should just specify an additional parameter for which
stream/attribute it get's connected to
- Jan
More information about the Squeak-dev
mailing list
|