03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

� changing directory and file attributes;<br />

� notifying changes;<br />

� manipulating drives and volumes;<br />

� peeking at file data without opening the file (used by some file format recognizers);<br />

� adding and removing file systems;<br />

� system functions to control and check the status of the server.<br />

Refer to the SDK for more details.<br />

13.3.2 The Current Directory<br />

Most RFs-related functions are stateless – that is, the results of a function don't depend on<br />

any functions previously called. That's why you can share CONE's RFs with other libraries<br />

used by your application.<br />

RFs has just one item of state: its current directory. When you open an RFs, usually its<br />

current directory is set to c:\; which as discussed, will be hidden from users in UIQ and may<br />

be just a ramdrive in some devices, or a flash-based drive in others. Indeed, c: is always an<br />

internal read/write drive on Symbian OS phones. On the Psion Series 5, it was a RAM disk,<br />

but on smartphones, it's a flash-based medium, which is (a) persistent with respect to taking<br />

the battery out – something phone users do frequently – and (b) slower, especially when<br />

handling reads and writes scattered over discontiguous sectors.<br />

You can use SetSessionPath() to change the current directory used by an open RFs.<br />

You can use SetDefaultPath() to change the initial current directory for all future RFs<br />

objects. The current directory includes the drive as well as directory names. So, unlike DOS,<br />

there is no concept of one current directory per drive.<br />

If you manipulate or rely on the current directory, make sure you use your own RFs rather<br />

than sharing one with other programs.<br />

13.3.3 Drives, File Systems, and Media<br />

Symbian OS supports at least three different media types:<br />

� The ROM file system that is assigned to z: was built by the ROM builder and is clearly<br />

read-only as far as Symbian OS programs are concerned.<br />

� An internal read/write drive that is always assigned to c: On smart- phones and<br />

communicators, this is a flash-based drive, with flash performance characteristics, on<br />

which data persists when all power is removed. Historically (i.e. Series 5 and netBook),<br />

the internal drive was a RAM drive, which had the benefit of being much faster, but<br />

which needed battery power to maintain even when the device was switched off, and<br />

whose entire contents would disappear when all power was removed (such devices had<br />

a secondary backup power scheme such as a backup battery – e.g. Psion Series 5 – or<br />

some reserved main battery power like the Psion Revo). Symbian OS takes enormous<br />

care to ensure that a sector write is atomic (that is, it completes entirely, or it doesn't<br />

complete at all). In turn, higher-level components such as STORE and DBMS use<br />

formats and protocols that ensure failure to write to the media never results in a corrupt<br />

file.<br />

� Removable media such as CF, MMC, MemoryStick, Microdrive or SD cards, on which,<br />

if present, the main drive is assigned to d:. Such technologies require little power to<br />

read, but rather more power to write. As battery power drains, it may become<br />

impossible to write to such a drive. Again, Symbian OS takes enormous care to ensure<br />

that a sector write is atomic.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!