Lecture 21Lecture 21
Version 1.0Version 1.0
Introduction to FileIntroduction to File
I/OI/O
2Rushdi Shams, Dept of CSE, KUET, Bangladesh
Different operations on filesDifferent operations on files
1.1. Creation of a...
3Rushdi Shams, Dept of CSE, KUET, Bangladesh
Various file concepts from oneVarious file concepts from one
programprogram
...
4Rushdi Shams, Dept of CSE, KUET, Bangladesh
5Rushdi Shams, Dept of CSE, KUET, Bangladesh
6Rushdi Shams, Dept of CSE, KUET, Bangladesh
7Rushdi Shams, Dept of CSE, KUET, Bangladesh
8Rushdi Shams, Dept of CSE, KUET, Bangladesh
9Rushdi Shams, Dept of CSE, KUET, Bangladesh
Error opening file??Error opening file??
 While opening the file in “r” mo...
10Rushdi Shams, Dept of CSE, KUET, Bangladesh
11Rushdi Shams, Dept of CSE, KUET, Bangladesh
 Now we will write a program that countsNow we will write a program that co...
12Rushdi Shams, Dept of CSE, KUET, Bangladesh
Upcoming SlideShare
Loading in …5
×

C-21

175 views

Published on

Published in: Education, Technology, Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
175
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

C-21

  1. 1. Lecture 21Lecture 21 Version 1.0Version 1.0 Introduction to FileIntroduction to File I/OI/O
  2. 2. 2Rushdi Shams, Dept of CSE, KUET, Bangladesh Different operations on filesDifferent operations on files 1.1. Creation of a new fileCreation of a new file 2.2. Opening an existing fileOpening an existing file 3.3. Reading from a fileReading from a file 4.4. Writing to a fileWriting to a file 5.5. Moving to a specific location in a file (seeking)Moving to a specific location in a file (seeking) 6.6. Closing a fileClosing a file
  3. 3. 3Rushdi Shams, Dept of CSE, KUET, Bangladesh Various file concepts from oneVarious file concepts from one programprogram  Now, we will see various concepts on files fromNow, we will see various concepts on files from just one program.just one program.
  4. 4. 4Rushdi Shams, Dept of CSE, KUET, Bangladesh
  5. 5. 5Rushdi Shams, Dept of CSE, KUET, Bangladesh
  6. 6. 6Rushdi Shams, Dept of CSE, KUET, Bangladesh
  7. 7. 7Rushdi Shams, Dept of CSE, KUET, Bangladesh
  8. 8. 8Rushdi Shams, Dept of CSE, KUET, Bangladesh
  9. 9. 9Rushdi Shams, Dept of CSE, KUET, Bangladesh Error opening file??Error opening file??  While opening the file in “r” mode, this mayWhile opening the file in “r” mode, this may happen because the file being opened may nothappen because the file being opened may not be present on the disk at allbe present on the disk at all
  10. 10. 10Rushdi Shams, Dept of CSE, KUET, Bangladesh
  11. 11. 11Rushdi Shams, Dept of CSE, KUET, Bangladesh  Now we will write a program that countsNow we will write a program that counts Character, newlines, blank spaces and tabs fromCharacter, newlines, blank spaces and tabs from a filea file
  12. 12. 12Rushdi Shams, Dept of CSE, KUET, Bangladesh

×