Главная » Просмотр файлов » Concepts with Symbian OS

Concepts with Symbian OS (779878), страница 36

Файл №779878 Concepts with Symbian OS (Symbian Books) 36 страницаConcepts with Symbian OS (779878) страница 362018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 36)

In MicrosoftWindows and Symbian OS, the root is dependent on the storagemedium, which is designated by a letter followed by a colon, and a‘\’ character to designate the root. The listing of the directory pathdiffers between operating systems. So the path to ‘readme.txt’ mightbe designated /software/graphics/readme.txt on Linux andC:\software\graphics\readme.txt on Symbian OS.StructureThe internal structure of a file must match the structure expected by theapplication that uses it. In addition, the file structure must match what172FILE SYSTEMS AND STORAGEthe operating system expects, if the operating system is to understand thatstructure.Some operating systems put very little emphasis on file structure.Linux has very few expectations of a file: it treats all files as a set ofbytes without any particular structure.

Microsoft Windows has a similarphilosophy. Operating systems like these associate applications withcertain files, but that association is not determined by how the data insidea file is structured.Other operating systems, on the other hand, do indeed pay attention tofile structure.

If a file structure is recognized, these operating systems havespecial operations that can be performed on the file. For example, DEC’sVMS operating system recognized special file structures. This support waswoven throughout the operating system, even into the APIs that supportedprogramming languages. Note that if an operating system is to supportstructured files, it must implement recognition of structured files throughthe system.The association of applications with certain files is sometimes implemented through file structure.

Linux has the notion of ‘magic cookies’ forthis association: the first bytes of a file are matched against a database ofapplications. If a match is found, that file is associated with the applicationfrom the database.Automatically deriving the meaning of a file can be problematic.The problem is that all such systems – including extensions and magiccookies – assume that the identified file characteristics uniquely specifya file type.

But this system is very easy to fool. In Microsoft Windows,for example, simply changing a file’s extension is enough to make theoperating system change the association. Changing a file’s suffix from.txt to .pdf, for example, causes Microsoft Windows to open the filewith a PDF reader instead of a file editor. Unfortunately, there is nofoolproof way to judge the type of a file.OperationsOperating systems define eight basic operations that can be done onfiles.

These operations are the ones that can be accessed through userinterfaces and programming APIs.• Creation : it takes two steps to create a file. First, there must be spaceallocation. Even when an empty file is created, a portion of disk spaceis allocated to it, if only for file information. The second step thatmust take place is that the file must be entered into the directory. TheFILES AND DIRECTORIES173information in the directory records the file’s name and the locationof the space allocated for that file on the disk.• Opening : to access a file’s contents, that file must be opened. The filename is the main input parameter to this operation.

When requestedto open a file, the operating system does several things. It checks tosee if the file exists. If it does not exist, the system may create it (orgive an error, depending on the system call used). Information aboutthe file is then recorded in internal tables. This information includesthe location of the file on the storage medium and the position of thenext byte to be read.

This system information is used by the operatingsystem for other operations. As a result of an open operation, a filehandle is created by the operating system within system memory andthat handle is passed back to the client. The file handle is then used toidentify the file during subsequent operations (instead of passing thefile name again and again).• Reading : information in a file would be useless if we did not readit. Reading a file causes the operating system to attempt to retrievebytes from an open file at that file’s current position. If the file still hasdata at its current position, those data bytes are retrieved and suppliedto the system caller, and the position pointer is moved to reflect theamount of data that was read.

Otherwise, an error is returned to thecaller.• Writing : a write operation adds data to a file. Data is typically writteninto a file’s space at the currently recorded position within the file.That data might overwrite existing data or it could be inserted intothe file. The current-position pointer for the file is then advanced toreflect the data that was written to the file. Note that writing data to afile usually makes the file grow in size and the operating system mightbe forced to allocate new disk space to accommodate that growth.• Repositioning : the current-position pointer can be reset.

Repositioning this pointer will affect where the next data byte is read from orwritten to.• Closing : closing a file does the reverse of opening. It updates the file’sinformation in the system directory and removes the file’s entry fromthe system’s open-file table. Any subsequent read or write operationsare likely to fail because the file handle in question is not in thesystem table.174FILE SYSTEMS AND STORAGE• Truncating : truncating a file means removing data that exists after thecurrent-position pointer for the file. Often, this operation is used toempty a file’s contents without deleting the file.• Deleting : to delete a file, the two steps for file creation need to bereversed. First, the file is removed from the directory with which itis associated. Secondly, the file’s space is reclaimed from the storagemedium.

Most file-system implementations permit a client to delete afile without a need to open it first.There are other common operations for a file that might combine someof the basic operations above. A file can be appended to, for example, byrepositioning the current-position pointer for the file to the end of the fileand performing a write operation. Files can be renamed or cut from onedirectory and pasted into another. A file can be copied by creating a newfile, opening the source file, and reading and writing between the two.Sometimes multiple position pointers are kept for a file in the filetable. It is sometimes advantageous to maintain a position pointer forreading and one for writing.

This has several implications for workingwith a file; for example, a read operation does not change where a writeoperation takes place. In fact, it is possible that these operations mayhappen simultaneously because one does not affect the other.The system’s open-file table is obviously central to manipulating files.The file table holds several pieces of information for each file that isopened.

We have pointed out several of these: name, current-positionpointer (or pointers) and location on the storage medium. In addition, theaccess rights for the file are usually stored in the table.Types of AccessWhile the operations of reading and writing seem straightforward, thereare actually several different methods for accessing files. Much of thedifference between these methods focuses on how the operating systemI/O implementation moves the current-position pointer in a file.Sequential access is probably the simplest method for file access. Thedata in a file is accessed in a linear order from beginning to end. Thecurrent-position pointer moves forward in a file after every read or writeoperation. Sequential access is usually the default access method for fileoperations.Direct or random access is a method where any part of a file is accessible.

Using direct access, a system call can place the current-positionIMPLEMENTATION OF A FILE SYSTEM175pointer anywhere in the file before reading or writing. There are twotypes of direct access: arbitrary access and fixed-length access. Arbitrarydirect access of files views a file only as a set of bytes and allows thecurrent-position pointer to point to any byte in the file. Fixed-length directaccess views a file as a set of blocks of fixed-length.

System calls that usefixed-length direct access move the current file pointer to specific blocks.Direct access is useful when access to information needs to be immediate. This is the case for implementations of database systems, wherefixed-length direct access is used to read records in the database. This isalso the case when reading a file means skipping to arbitrary positionswithin that file, such as reading digital music data or processing video.Another way of accessing files is by indexed access.

The index of a fileis analogous to the index of a book: data within the file is recorded alongwith its position. This means that there are typically two files used forindexed access: an index file and a data file. Once pertinent data is foundin the index file – say a keyword or product ID – the position withinthe data file is obtained and used directly to retrieve the information.Indexed access thus builds on top of direct access methods. Modernoperating systems have moved away from implementing indexed access;it is offered as an add-on method through special libraries rather than acore operating system service.8.2 Implementation of a File SystemThe implementation of a file system is a lesson in abstraction. A file systemmust support the concepts of files and hierarchical directory structures.Operating systems typically provide the same interface – file creation,opening a file, reading, writing, etc.

– no matter where a file is located.However, a file system on a CD-ROM is implemented in a very differentmanner from a file system in the memory of a smartphone. But to aprogram, both file systems look the same.We explore how this abstraction is implemented in this section. Wefirst explore the concepts an implementation must use.

Характеристики

Тип файла
PDF-файл
Размер
1,2 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6358
Авторов
на СтудИзбе
311
Средний доход
с одного платного файла
Обучение Подробнее