SlideShare a Scribd company logo
OSFile #2
Interface & API
Classes
OSF_Directory

Templates

OSF_Exception

OSF_DiskList

OSF_File
OSF_FileSystem

Interfaces

OSF_PlainAPI

OSF_DirectoryInterface

OSF_TestUnit

OSF_FileInterface

OSF_Types

OSF_VHDDInterface

OSF_VHDD

OSF_DiskListInterface
OSF_FileSystemInterface
OSF_PlainAPI
Easy to use
You can use OSF_PlainAPI to easy non-object
oriented access.
OSF_PlainAPI
OSF_FileHandle* OSF_Open(string path);
void OSF_Close(OSF_FileHandle* fileHandle);
OSF_PlainAPIInt OSF_Read(OSF_FileHandle* fileHandle, void* buf, OSF_PlainAPIInt count);
OSF_PlainAPIInt OSF_Write(OSF_FileHandle* fileHandle, void* buf, OSF_PlainAPIInt count);
void OSF_Ls(string path, void (*callback)(OSF_DirRecord*));
OSF_OWNER OSF_chownFile(string path);
void OSF_chownFile(OSF_OWNER owner, string path);
OSF_PERMISSION OSF_chmodFile(string path);
void OSF_chmodFile(OSF_PERMISSION permission, string path);
void OSF_remove(string dir, string filename);
Console example #1
if (command == "write") {
string filename;
cin >> filename;
cin >> buffer;
OSF_FileHandle* handle = OSF_Open(path + "/" + filename, true);
OSF_Write(handle, buffer, sizeof (buffer));
OSF_Close(handle);
}
Console example #2

if (command == "ls") {
OSF_Ls(path, &ls_print);
cout << endl;
}
Console example #3
if (command == "setowner") {
string filename;
cin >> filename;
OSF_OWNER owner;
cin >> owner;
OSF_chownFile(owner, path + "/" + filename);
}
OOP
Object Oriented Programing
Interfaces
OSF_Types - contain type and preprocessor macros
OSF_VHDDInterface

- represent your virtual hard disk

OSF_FileSystemInterface - represent file system on the virtual hard disk
OSF_DirectoryInterface

- represent a directory

OSF_FileInterface

- represent a file

OSF_DiskListInterface

- provide data organization interface
example #create
//Create new virtual hard disk
vHDD = new OSF_VHDD(filePath 128, 80, true);
//create new file system of the disk
OSF_FileSystemHeader header;
OSF_scpy(header.diskName, "testDisk");
fileSystem = new OSF_FileSystem(vHDD, &header, 2);
example #create direcotry
OSF_DirectoryInterface* rootDir = plainAPIData->fs->getRootDir();
OSF_DirectoryInterface* d1 = rootDir->createDir("d1");
OSF_DirectoryInterface* d2_1 = d1->createDir("d2_1");
OSF_DirectoryInterface* d2_2 = d2_1->createDir("d2_2");
OSF_DirectoryInterface* d3 = d2_1->createDir("d3");
//…. OR
rootDir->mkdir(“d1/d2/d3/d4/…”);
example #file
//create
OSF_FileInterface* file = directory->createFile("f1");
//write to file
int bufSize = clusterSize * clusterCount;
char* buf = testUnit->createBuffer(bufSize); //random data
f1->write(buf, 0, 2);
OSF_Directory & OSF_File
Tests
Test classes
System contain OSF_TestUnit. The class provide interface for c++ testing.
Make possible integrate OSF tests with NetBeans IDE and other graphic
interfaces.
Tests
https://github.com/SebastianPozoga/OSFile
Biblografia
“Jądro systemu UNIX” - Vahalia - Nowe
horyzonty
“Anatomia PC. Wydanie X”, Piotr Metzger Helion

More Related Content

DOCX
Files let you store data on secondary storage such as a hard disk so that you...
Bern Jamie
 
PDF
File handling C program
Thesis Scientist Private Limited
 
PPTX
file management in c language
chintan makwana
 
PPTX
File Handling in C
Subhanshu Maurya
 
PPTX
File handling in c
mohit biswal
 
PDF
File_Management_in_C
NabeelaNousheen
 
PPTX
File Management in C
Paurav Shah
 
PPT
File in c
Prabhu Govind
 
Files let you store data on secondary storage such as a hard disk so that you...
Bern Jamie
 
File handling C program
Thesis Scientist Private Limited
 
file management in c language
chintan makwana
 
File Handling in C
Subhanshu Maurya
 
File handling in c
mohit biswal
 
File_Management_in_C
NabeelaNousheen
 
File Management in C
Paurav Shah
 
File in c
Prabhu Govind
 

What's hot (19)

PPTX
File Management in C
Munazza-Mah-Jabeen
 
PPTX
Concept of file handling in c
MugdhaSharma11
 
PPT
File Management
Ravinder Kamboj
 
PDF
PHP file handling
wahidullah mudaser
 
PDF
Unicode (UTF-8) with PHP 5.3, MySQL 5.5 and HTML5 Cheat Sheet (2011)
Francois Cardinaux
 
PPT
Lecture 20 - File Handling
Md. Imran Hossain Showrov
 
PPSX
C programming file handling
argusacademy
 
PPTX
File in C programming
Samsil Arefin
 
PPTX
C Programming Unit-5
Vikram Nandini
 
PDF
Module 03 File Handling in C
Tushar B Kute
 
DOCX
Understanding c file handling functions with examples
Muhammed Thanveer M
 
PPT
File handling in c
thirumalaikumar3
 
PPTX
File handling in C
Rabin BK
 
PPTX
File Handling and Command Line Arguments in C
Mahendra Yadav
 
PPTX
File management in C++
apoorvaverma33
 
PPTX
File handling in C
Kamal Acharya
 
PPT
File handling
Ans Ali
 
PPT
File handling-c programming language
thirumalaikumar3
 
PPT
File handling in c
David Livingston J
 
File Management in C
Munazza-Mah-Jabeen
 
Concept of file handling in c
MugdhaSharma11
 
File Management
Ravinder Kamboj
 
PHP file handling
wahidullah mudaser
 
Unicode (UTF-8) with PHP 5.3, MySQL 5.5 and HTML5 Cheat Sheet (2011)
Francois Cardinaux
 
Lecture 20 - File Handling
Md. Imran Hossain Showrov
 
C programming file handling
argusacademy
 
File in C programming
Samsil Arefin
 
C Programming Unit-5
Vikram Nandini
 
Module 03 File Handling in C
Tushar B Kute
 
Understanding c file handling functions with examples
Muhammed Thanveer M
 
File handling in c
thirumalaikumar3
 
File handling in C
Rabin BK
 
File Handling and Command Line Arguments in C
Mahendra Yadav
 
File management in C++
apoorvaverma33
 
File handling in C
Kamal Acharya
 
File handling
Ans Ali
 
File handling-c programming language
thirumalaikumar3
 
File handling in c
David Livingston J
 
Ad

Viewers also liked (18)

PDF
Programming style
Sebastian Pożoga
 
PDF
Events poznań 7.02.2013
Sebastian Pożoga
 
PDF
Events Poznań 18.01.2013
Sebastian Pożoga
 
PDF
gameJUMP.pl#about
Sebastian Pożoga
 
PDF
The future of technologies
Sebastian Pożoga
 
DOC
Dd
thedhy_ok
 
PDF
Game jump: frontend introduction #1
Sebastian Pożoga
 
PDF
Go dla elektronika
Sebastian Pożoga
 
PDF
Fosdem i inne konferencje
Sebastian Pożoga
 
PDF
Hardgroup - Raspberry PI #1
Sebastian Pożoga
 
PDF
Sails.js - Overview
Sebastian Pożoga
 
PDF
Overview of AngularJS
Sebastian Pożoga
 
PPTX
IoT dla programistów
Sebastian Pożoga
 
PDF
3D Printing
Sebastian Pożoga
 
PDF
Angular2 - Co jest grane?!?!
Sebastian Pożoga
 
PDF
Blender3 d
Sebastian Pożoga
 
PPTX
Shahbaz ppt
Shahbaz Ahmed
 
Programming style
Sebastian Pożoga
 
Events poznań 7.02.2013
Sebastian Pożoga
 
Events Poznań 18.01.2013
Sebastian Pożoga
 
gameJUMP.pl#about
Sebastian Pożoga
 
The future of technologies
Sebastian Pożoga
 
Game jump: frontend introduction #1
Sebastian Pożoga
 
Go dla elektronika
Sebastian Pożoga
 
Fosdem i inne konferencje
Sebastian Pożoga
 
Hardgroup - Raspberry PI #1
Sebastian Pożoga
 
Sails.js - Overview
Sebastian Pożoga
 
Overview of AngularJS
Sebastian Pożoga
 
IoT dla programistów
Sebastian Pożoga
 
3D Printing
Sebastian Pożoga
 
Angular2 - Co jest grane?!?!
Sebastian Pożoga
 
Blender3 d
Sebastian Pożoga
 
Shahbaz ppt
Shahbaz Ahmed
 
Ad

Similar to OSFile#2 (20)

PPTX
Device file api 2
SwetaLeena1
 
PPTX
Char Drivers And Debugging Techniques
YourHelper1
 
PPTX
2nd unit part 1
Pavan Illa
 
PPTX
Unix-module3.pptx
ssuser8594b8
 
PPTX
18CS56-UP-Module 3.pptx
ChenamPawan
 
PPTX
File System Interface
chandinisanz
 
PPTX
File system interface
Dayan Ahmed
 
PDF
Working with the IFS on System i
Chuck Walker
 
PPTX
MODULE 3.1 updated-18cs56.pptx
ManasaPJ1
 
PDF
Advfs 3 in-memory structures
Justin Goldberg
 
PDF
TLPI Chapter 14 File Systems
Shu-Yu Fu
 
PDF
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
DefCamp
 
PDF
The Linux Kernel Implementation of Pipes and FIFOs
Divye Kapoor
 
PPT
Overview of Parallel HDF5
The HDF-EOS Tools and Information Center
 
PDF
File system
WajeehaBaig
 
DOC
Lesson 10 Application Program Interface
Laguna State Polytechnic University
 
PDF
Files and streams
Pranali Chaudhari
 
PPTX
file handling final3333.pptx
radhushri
 
PPTX
Unit 6 OSY.pptx aaaaaaaaaaaaaaaaaaaaaaaa
harshlad847
 
PPTX
File management in OS
Bhavik Vashi
 
Device file api 2
SwetaLeena1
 
Char Drivers And Debugging Techniques
YourHelper1
 
2nd unit part 1
Pavan Illa
 
Unix-module3.pptx
ssuser8594b8
 
18CS56-UP-Module 3.pptx
ChenamPawan
 
File System Interface
chandinisanz
 
File system interface
Dayan Ahmed
 
Working with the IFS on System i
Chuck Walker
 
MODULE 3.1 updated-18cs56.pptx
ManasaPJ1
 
Advfs 3 in-memory structures
Justin Goldberg
 
TLPI Chapter 14 File Systems
Shu-Yu Fu
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
DefCamp
 
The Linux Kernel Implementation of Pipes and FIFOs
Divye Kapoor
 
Overview of Parallel HDF5
The HDF-EOS Tools and Information Center
 
File system
WajeehaBaig
 
Lesson 10 Application Program Interface
Laguna State Polytechnic University
 
Files and streams
Pranali Chaudhari
 
file handling final3333.pptx
radhushri
 
Unit 6 OSY.pptx aaaaaaaaaaaaaaaaaaaaaaaa
harshlad847
 
File management in OS
Bhavik Vashi
 

More from Sebastian Pożoga (6)

PDF
GoLang & GoatCore
Sebastian Pożoga
 
PDF
Angular2 - In Action
Sebastian Pożoga
 
PDF
Meet.php #gpio
Sebastian Pożoga
 
PDF
Game jump frontend introduction #workshop1
Sebastian Pożoga
 
PDF
Poznań 4.04.2013
Sebastian Pożoga
 
GoLang & GoatCore
Sebastian Pożoga
 
Angular2 - In Action
Sebastian Pożoga
 
Meet.php #gpio
Sebastian Pożoga
 
Game jump frontend introduction #workshop1
Sebastian Pożoga
 
Poznań 4.04.2013
Sebastian Pożoga
 

Recently uploaded (20)

PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
The Future of Artificial Intelligence (AI)
Mukul
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Software Development Methodologies in 2025
KodekX
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Doc9.....................................
SofiaCollazos
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 

OSFile#2