SlideShare uma empresa Scribd logo
1 de 22
Chapter 8 FILE PROCCESSING 8.1 Introduction 8.2 Introduction to File I/O 8.2.1 declaring FILE variables 8.2.2 opening a Disk Files for I/O   file open verification 8.2.3 reading and writing to Disk File 8.2.4 closing a Disk Files 8.2.5  EOF
8.1  Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
8.1  Introduction (cont..) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
8.1  Introduction (cont..) ,[object Object],[object Object],[object Object],[object Object]
8.2  Introduction to file I/O ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
8.2.1 Declaring FILE variable ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],8.2.2 Opening a File, fopen previous  sourcecode
8.2.2 Opening a File (cont..) ,[object Object],[object Object],[object Object]
8.2.2 Opening a File (cont..) Table: 8.1 Filename and mode Read & write, but append instead of overwrite “ a+” Open file to write, but append instead of overwrite “ a” Read & Write, do not destroy file if it exists “ r+” Open file to read “ r” Read & write, but overwrite file if it exists “ w+” Open file to write (create a file) “ w” description Mode
mode (r) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
mode (a) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],File open verification
File open verification (cont..) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
8.2.3  Writing to Disk File ,[object Object],[object Object],[object Object],[object Object],previous  sourcecode
fputs( ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
8.2.3  Reading to Disk File ,[object Object],[object Object],[object Object],[object Object],previous  sourcecode
fgets( ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
8.2.4 Closing a Disk File ,[object Object],[object Object],[object Object],fp is a pointer file variable
End of File (EOF) ,[object Object],[object Object],[object Object],[object Object]
End of File (EOF) (cont..) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

C 檔案輸入與輸出
C 檔案輸入與輸出C 檔案輸入與輸出
C 檔案輸入與輸出PingLun Liao
 
Files let you store data on secondary storage such as a hard disk so that you...
Files let you store data on secondary storage such as a hard disk so that you...Files let you store data on secondary storage such as a hard disk so that you...
Files let you store data on secondary storage such as a hard disk so that you...Bern Jamie
 
Iipdrpx4npm0n.cracked
Iipdrpx4npm0n.crackedIipdrpx4npm0n.cracked
Iipdrpx4npm0n.crackedsharma_lokraj
 
A framework for the design and execution of heterogeneous distributed applica...
A framework for the design and execution of heterogeneous distributed applica...A framework for the design and execution of heterogeneous distributed applica...
A framework for the design and execution of heterogeneous distributed applica...Jonathan Bardin
 
Files and Directories in PHP
Files and Directories in PHPFiles and Directories in PHP
Files and Directories in PHPNicole Ryan
 

Mais procurados (9)

Php files
Php filesPhp files
Php files
 
C 檔案輸入與輸出
C 檔案輸入與輸出C 檔案輸入與輸出
C 檔案輸入與輸出
 
Files let you store data on secondary storage such as a hard disk so that you...
Files let you store data on secondary storage such as a hard disk so that you...Files let you store data on secondary storage such as a hard disk so that you...
Files let you store data on secondary storage such as a hard disk so that you...
 
PHP - Introduction to File Handling with PHP
PHP -  Introduction to  File Handling with PHPPHP -  Introduction to  File Handling with PHP
PHP - Introduction to File Handling with PHP
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Iipdrpx4npm0n.cracked
Iipdrpx4npm0n.crackedIipdrpx4npm0n.cracked
Iipdrpx4npm0n.cracked
 
Trm 02 10 07vilnius
Trm 02 10 07vilniusTrm 02 10 07vilnius
Trm 02 10 07vilnius
 
A framework for the design and execution of heterogeneous distributed applica...
A framework for the design and execution of heterogeneous distributed applica...A framework for the design and execution of heterogeneous distributed applica...
A framework for the design and execution of heterogeneous distributed applica...
 
Files and Directories in PHP
Files and Directories in PHPFiles and Directories in PHP
Files and Directories in PHP
 

Destaque (20)

Ch6 pointers (latest)
Ch6 pointers (latest)Ch6 pointers (latest)
Ch6 pointers (latest)
 
Ch3 repetition
Ch3 repetitionCh3 repetition
Ch3 repetition
 
9 lan
9 lan9 lan
9 lan
 
Ch3 selection
Ch3 selectionCh3 selection
Ch3 selection
 
10 high speedla-ns
10 high speedla-ns10 high speedla-ns
10 high speedla-ns
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 
Ch7 structures
Ch7 structuresCh7 structures
Ch7 structures
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
13 atm
13 atm13 atm
13 atm
 
Ch5 array nota
Ch5 array notaCh5 array nota
Ch5 array nota
 
6 data linkcontrol
6  data linkcontrol6  data linkcontrol
6 data linkcontrol
 
Ch1 principles of software development
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software development
 
8 spread spectrum
8 spread spectrum8 spread spectrum
8 spread spectrum
 
5 digital datacomm
5 digital datacomm5 digital datacomm
5 digital datacomm
 
12 wireless la-ns
12 wireless la-ns12 wireless la-ns
12 wireless la-ns
 
AM Receivers
AM ReceiversAM Receivers
AM Receivers
 
11 circuit-packet
11 circuit-packet11 circuit-packet
11 circuit-packet
 
Types of AM Receiver
Types of AM Receiver Types of AM Receiver
Types of AM Receiver
 
Chapter 3 am receivers
Chapter 3 am receiversChapter 3 am receivers
Chapter 3 am receivers
 
4 signal encodingtechniques
4 signal encodingtechniques4 signal encodingtechniques
4 signal encodingtechniques
 

Semelhante a File Processing Chapter Summary (20)

Unit5 C
Unit5 C Unit5 C
Unit5 C
 
File handling in 'C'
File handling in 'C'File handling in 'C'
File handling in 'C'
 
File in C language
File in C languageFile in C language
File in C language
 
File_Handling in C.ppt
File_Handling in C.pptFile_Handling in C.ppt
File_Handling in C.ppt
 
File_Handling in C.ppt
File_Handling in C.pptFile_Handling in C.ppt
File_Handling in C.ppt
 
Introduction of file handling
Introduction of file handlingIntroduction of file handling
Introduction of file handling
 
Module 03 File Handling in C
Module 03 File Handling in CModule 03 File Handling in C
Module 03 File Handling in C
 
Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
 
File Handling in C Programming
File Handling in C ProgrammingFile Handling in C Programming
File Handling in C Programming
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
 
File handling-c
File handling-cFile handling-c
File handling-c
 
File in cpp 2016
File in cpp 2016 File in cpp 2016
File in cpp 2016
 
WK-12-13-file f classs 12 computer science from kv.
WK-12-13-file f classs 12 computer science from kv.WK-12-13-file f classs 12 computer science from kv.
WK-12-13-file f classs 12 computer science from kv.
 
File management
File managementFile management
File management
 
05 File Handling Upload Mysql
05 File Handling Upload Mysql05 File Handling Upload Mysql
05 File Handling Upload Mysql
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Unit 3
Unit  3Unit  3
Unit 3
 
C Language Unit-5
C Language Unit-5C Language Unit-5
C Language Unit-5
 
Files_in_C.ppt
Files_in_C.pptFiles_in_C.ppt
Files_in_C.ppt
 

Mais de Hattori Sidek

Chapter 4 frequency modulation
Chapter 4 frequency modulationChapter 4 frequency modulation
Chapter 4 frequency modulationHattori Sidek
 
3. transmission media
3. transmission media3. transmission media
3. transmission mediaHattori Sidek
 
2[1].1 data transmission
2[1].1 data transmission2[1].1 data transmission
2[1].1 data transmissionHattori Sidek
 
14 congestionin datanetworks
14 congestionin datanetworks14 congestionin datanetworks
14 congestionin datanetworksHattori Sidek
 
Chapter 2 amplitude_modulation
Chapter 2 amplitude_modulationChapter 2 amplitude_modulation
Chapter 2 amplitude_modulationHattori Sidek
 
Chapter 6 dc motor speed control
Chapter 6 dc motor speed controlChapter 6 dc motor speed control
Chapter 6 dc motor speed controlHattori Sidek
 

Mais de Hattori Sidek (12)

Chapter 4 frequency modulation
Chapter 4 frequency modulationChapter 4 frequency modulation
Chapter 4 frequency modulation
 
7 multiplexing
7 multiplexing7 multiplexing
7 multiplexing
 
3. transmission media
3. transmission media3. transmission media
3. transmission media
 
2[1].1 data transmission
2[1].1 data transmission2[1].1 data transmission
2[1].1 data transmission
 
14 congestionin datanetworks
14 congestionin datanetworks14 congestionin datanetworks
14 congestionin datanetworks
 
01 pengenalan
01 pengenalan01 pengenalan
01 pengenalan
 
01 berkenalan
01 berkenalan01 berkenalan
01 berkenalan
 
Chapter 2 amplitude_modulation
Chapter 2 amplitude_modulationChapter 2 amplitude_modulation
Chapter 2 amplitude_modulation
 
Comm introduction
Comm introductionComm introduction
Comm introduction
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
Chapter 6 edit
Chapter 6 editChapter 6 edit
Chapter 6 edit
 
Chapter 6 dc motor speed control
Chapter 6 dc motor speed controlChapter 6 dc motor speed control
Chapter 6 dc motor speed control
 

Último

Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

Último (20)

Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 

File Processing Chapter Summary

  • 1. Chapter 8 FILE PROCCESSING 8.1 Introduction 8.2 Introduction to File I/O 8.2.1 declaring FILE variables 8.2.2 opening a Disk Files for I/O file open verification 8.2.3 reading and writing to Disk File 8.2.4 closing a Disk Files 8.2.5 EOF
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. 8.2.2 Opening a File (cont..) Table: 8.1 Filename and mode Read & write, but append instead of overwrite “ a+” Open file to write, but append instead of overwrite “ a” Read & Write, do not destroy file if it exists “ r+” Open file to read “ r” Read & write, but overwrite file if it exists “ w+” Open file to write (create a file) “ w” description Mode
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.