SlideShare a Scribd company logo
1 of 19
Download to read offline
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

What's hot

Understanding c file handling functions with examples
Understanding c file handling functions with examplesUnderstanding c file handling functions with examples
Understanding c file handling functions with examples
Muhammed Thanveer M
 

What's hot (19)

File Management in C
File Management in CFile Management in C
File Management in C
 
Concept of file handling in c
Concept of file handling in cConcept of file handling in c
Concept of file handling in c
 
File Management
File ManagementFile Management
File Management
 
PHP file handling
PHP file handling PHP file handling
PHP file handling
 
Unicode (UTF-8) with PHP 5.3, MySQL 5.5 and HTML5 Cheat Sheet (2011)
Unicode (UTF-8) with PHP 5.3, MySQL 5.5 and HTML5 Cheat Sheet (2011)Unicode (UTF-8) with PHP 5.3, MySQL 5.5 and HTML5 Cheat Sheet (2011)
Unicode (UTF-8) with PHP 5.3, MySQL 5.5 and HTML5 Cheat Sheet (2011)
 
Lecture 20 - File Handling
Lecture 20 - File HandlingLecture 20 - File Handling
Lecture 20 - File Handling
 
C programming file handling
C  programming file handlingC  programming file handling
C programming file handling
 
File in C programming
File in C programmingFile in C programming
File in C programming
 
C Programming Unit-5
C Programming Unit-5C Programming Unit-5
C Programming Unit-5
 
Module 03 File Handling in C
Module 03 File Handling in CModule 03 File Handling in C
Module 03 File Handling in C
 
Understanding c file handling functions with examples
Understanding c file handling functions with examplesUnderstanding c file handling functions with examples
Understanding c file handling functions with examples
 
File handling in c
File  handling in cFile  handling in c
File handling in c
 
File handling in C
File handling in CFile handling in C
File handling in C
 
File Handling and Command Line Arguments in C
File Handling and Command Line Arguments in CFile Handling and Command Line Arguments in C
File Handling and Command Line Arguments in C
 
File management in C++
File management in C++File management in C++
File management in C++
 
File handling in C
File handling in CFile handling in C
File handling in C
 
File handling
File handlingFile handling
File handling
 
File handling-c programming language
File handling-c programming languageFile handling-c programming language
File handling-c programming language
 
File handling in c
File handling in cFile handling in c
File handling in c
 

Viewers also liked

Viewers also liked (18)

Programming style
Programming styleProgramming style
Programming style
 
Events poznań 7.02.2013
Events poznań 7.02.2013Events poznań 7.02.2013
Events poznań 7.02.2013
 
Air
AirAir
Air
 
Events Poznań 18.01.2013
Events Poznań 18.01.2013Events Poznań 18.01.2013
Events Poznań 18.01.2013
 
gameJUMP.pl#about
gameJUMP.pl#aboutgameJUMP.pl#about
gameJUMP.pl#about
 
The future of technologies
The future of technologiesThe future of technologies
The future of technologies
 
Dd
DdDd
Dd
 
Game jump: frontend introduction #1
Game jump: frontend introduction #1Game jump: frontend introduction #1
Game jump: frontend introduction #1
 
Go dla elektronika
Go dla elektronikaGo dla elektronika
Go dla elektronika
 
Fosdem i inne konferencje
Fosdem i inne konferencjeFosdem i inne konferencje
Fosdem i inne konferencje
 
Hardgroup - Raspberry PI #1
Hardgroup - Raspberry PI #1Hardgroup - Raspberry PI #1
Hardgroup - Raspberry PI #1
 
Sails.js - Overview
Sails.js - OverviewSails.js - Overview
Sails.js - Overview
 
Overview of AngularJS
Overview of AngularJS Overview of AngularJS
Overview of AngularJS
 
IoT dla programistów
IoT dla programistówIoT dla programistów
IoT dla programistów
 
3D Printing
3D Printing3D Printing
3D Printing
 
Angular2 - Co jest grane?!?!
Angular2 - Co jest grane?!?! Angular2 - Co jest grane?!?!
Angular2 - Co jest grane?!?!
 
Blender3 d
Blender3 dBlender3 d
Blender3 d
 
Shahbaz ppt
Shahbaz  pptShahbaz  ppt
Shahbaz ppt
 

Similar to OSFile#2

Chapter 13.1.10
Chapter 13.1.10Chapter 13.1.10
Chapter 13.1.10
patcha535
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System i
Chuck Walker
 

Similar to OSFile#2 (20)

4 text file
4 text file4 text file
4 text file
 
Handout#01
Handout#01Handout#01
Handout#01
 
C 檔案輸入與輸出
C 檔案輸入與輸出C 檔案輸入與輸出
C 檔案輸入與輸出
 
File Management
File ManagementFile Management
File Management
 
The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOs
 
File Handling in c.ppt
File Handling in c.pptFile Handling in c.ppt
File Handling in c.ppt
 
Unit 5 dwqb ans
Unit 5 dwqb ansUnit 5 dwqb ans
Unit 5 dwqb ans
 
PerlScripting
PerlScriptingPerlScripting
PerlScripting
 
PHP 5.3
PHP 5.3PHP 5.3
PHP 5.3
 
Php basics
Php basicsPhp basics
Php basics
 
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdfEASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
EASY UNDERSTANDING OF FILES IN C LANGUAGE.pdf
 
Module 5 file cp
Module 5 file cpModule 5 file cp
Module 5 file cp
 
Chapter 13.1.10
Chapter 13.1.10Chapter 13.1.10
Chapter 13.1.10
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System i
 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5
 
PHP Security on i5/OS
PHP Security on i5/OSPHP Security on i5/OS
PHP Security on i5/OS
 
File in C language
File in C languageFile in C language
File in C language
 
File management
File managementFile management
File management
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
File management
File managementFile management
File management
 

More from Sebastian Pożoga

GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
Sebastian Pożoga
 

More from Sebastian Pożoga (6)

GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
 
Angular2 - In Action
Angular2  - In ActionAngular2  - In Action
Angular2 - In Action
 
Meet.php #gpio
Meet.php #gpioMeet.php #gpio
Meet.php #gpio
 
Game jump frontend introduction #workshop1
Game jump  frontend introduction #workshop1Game jump  frontend introduction #workshop1
Game jump frontend introduction #workshop1
 
OSFile
OSFileOSFile
OSFile
 
Poznań 4.04.2013
Poznań 4.04.2013Poznań 4.04.2013
Poznań 4.04.2013
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

OSFile#2