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

Concept of file handling in c
Concept of file handling in cConcept of file handling in c
Concept of file handling in cMugdhaSharma11
 
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)Francois Cardinaux
 
C programming file handling
C  programming file handlingC  programming file handling
C programming file handlingargusacademy
 
File in C programming
File in C programmingFile in C programming
File in C programmingSamsil Arefin
 
Module 03 File Handling in C
Module 03 File Handling in CModule 03 File Handling in C
Module 03 File Handling in CTushar B Kute
 
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 examplesMuhammed Thanveer M
 
File handling in C
File handling in CFile handling in C
File handling in CRabin BK
 
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 CMahendra Yadav
 
File management in C++
File management in C++File management in C++
File management in C++apoorvaverma33
 
File handling
File handlingFile handling
File handlingAns Ali
 
File handling-c programming language
File handling-c programming languageFile handling-c programming language
File handling-c programming languagethirumalaikumar3
 

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 (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

C 檔案輸入與輸出
C 檔案輸入與輸出C 檔案輸入與輸出
C 檔案輸入與輸出PingLun Liao
 
File Management
File ManagementFile Management
File Managementjani parth
 
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 FIFOsDivye Kapoor
 
File Handling in c.ppt
File Handling in c.pptFile Handling in c.ppt
File Handling in c.pptBhumaNagaPavan
 
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.pdfsudhakargeruganti
 
Chapter 13.1.10
Chapter 13.1.10Chapter 13.1.10
Chapter 13.1.10patcha535
 
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 iChuck Walker
 
VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5VIT351 Software Development VI Unit5
VIT351 Software Development VI Unit5YOGESH SINGH
 
PHP Security on i5/OS
PHP Security on i5/OSPHP Security on i5/OS
PHP Security on i5/OSZendCon
 
File management
File managementFile management
File managementsumathiv9
 

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

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

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

OSFile#2