1 / 16

វិទ្យាស្ថានជាតិពហុបច្ចេកទេសកម្ពុជា មហាវិទ្យាល័យ វិទ្យាសាស្រ្តកុំព្យូរទ័រ

វិទ្យាស្ថានជាតិពហុបច្ចេកទេសកម្ពុជា មហាវិទ្យាល័យ វិទ្យាសាស្រ្តកុំព្យូរទ័រ មុខវិជ្ជា Operating System កិច្ចការស្រាវជ្រាវអំពី : 1.File Concept 2.Access Methods សមាជិកស្រាវជ្រាវមាន : 1 កាន់ ចាន់រាសី បុត្រ 2 កែវ ហ៊ុយ ម៉េង 3 អុល គឹមអេង 4 នី មិ​ នា 5 កាយ ប៊ុន ហេង. File Concept.

mercia
Download Presentation

វិទ្យាស្ថានជាតិពហុបច្ចេកទេសកម្ពុជា មហាវិទ្យាល័យ វិទ្យាសាស្រ្តកុំព្យូរទ័រ

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. វិទ្យាស្ថានជាតិពហុបច្ចេកទេសកម្ពុជាវិទ្យាស្ថានជាតិពហុបច្ចេកទេសកម្ពុជា មហាវិទ្យាល័យ វិទ្យាសាស្រ្តកុំព្យូរទ័រ មុខវិជ្ជា Operating System កិច្ចការស្រាវជ្រាវអំពី: 1.File Concept 2.Access Methods សមាជិកស្រាវជ្រាវមាន: 1កាន់ ចាន់រាសីបុត្រ 2កែវ ហ៊ុយ ម៉េង 3 អុល គឹមអេង 4នី មិ​នា 5 កាយ ប៊ុន ហេង

  2. File Concept • មានពីរប្រភេទគឺ: • Data • numeric • character • binary • Program

  3. រចនាសំម្ព័ន្ធFile • រចនាសំម្ព័ន្ធស្រួលមាន: • Lines • Fixed length • Variable length • រចនាសំម្ព័ន្ធស្មុកស្មាញមាន: • Formatted document • Relocatable load file • វាអាចធ្វើឲ្យដូចគ្នាដោយវិធីមួយដោយការបញ្ជូលតាមលក្ខណ:ខាងក្រោម; • នណាជាអ្នកធ្វើ: • Operating system • Program

  4. File Attributes • Name:អាចឲ្យគេអានបាន • Identifier : មាន tag តែមួយរឺ(number)ដើម្បីសំគាល់file មួយនៅក្នុងfile system. • Type :តំរូវការសំរាប់ system ដែលអាច support ប្រភេទផ្សេងៗ. • Location :ចង្អុលទៅកាន់ទីតាំងfileនៅលើdevice.

  5. Size– current file size • Protection :គ្រប់គ្រង់ទៅលើអ្វីដែលអាច Reading , Writing ,Executing. • Time, date, and user identification :data សំរាប់ការការពារ,សុវត្តិភាព ហើយនឹងការប្រីនៅលើ monitoring • រាល់ពត័មានអំពីfile ត្រូវបានរក្សាទុកនៅក្នុង directory Structure​,ដែលបានរក្សាទុកក្នុងDisk.

  6. File Operations • File គឺជាការសង្ខេបនៃប្រភេទDataមួយ • Create • Write • Read • Reposition within file • Delete • Truncate • Open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory • Close (Fi) – move the content of entry Fi in memory to directory structure on disk

  7. Open Files • ផែ្នកនៃDataខ្លះៗគឺត្រូវការដើម្បីរៀបចំក្នុងការOpen file: • File pointer: គឺចង្អុលទៅកាន់ទីតាំង read/write ចុងក្រោយ, ហើយមួយ process មានfile open. • File-open count: ការរាប់ចំនួនលេខនៅពេលfileមួយបើកដើម្បីអនុញ្ញាតឲ្យយកចេញ dataពីតារាង Open file ពេលដែលProcesses ចុងក្រោយត្រូវបានបិទវា។ • Disk location of the file:លាក់ទុកdataហើយ​accessពត័មាន • Access rights:មួយprocessអាចaccessពត័មានមួយរបៀប

  8. Open File Locking • វាបានផ្តល់ឲ្យតាម operating systems and file systems • Mediates access to a file • Mandatory or advisory: • Mandatoryគឺaccessបានបដិសេធ មិនពឹងលើ locks heldហើយការស្នើរសុំ • Advisory :processes អាចស្វែងរកstatus of locks ហើយសំរេចអ្វីដែលត្រូវធ្វើ។

  9. File Locking Example – Java API import java.io.*; import java.nio.channels.*; public class LockingExample{ public static final boolean EXCLUSIVE = false; public static final boolean SHARED = true; public static void main(String arsg[]) throws IOException{ FileLocksharedLock = null; FileLockexclusiveLock = null; try { RandomAccessFileraf = new RandomAccessFile("file.txt", "rw"); // get the channel for the file FileChannelch = raf.getChannel(); // this locks the first half of the file - exclusive exclusiveLock = ch.lock(0, raf.length()/2, EXCLUSIVE); /** Now modify the data . . . */ // release the lock exclusiveLock.release();

  10. File Locking Example – Java API (cont) // this locks the second half of the file - shared sharedLock = ch.lock(raf.length()/2+1, raf.length(), SHARED); /** Now read the data . . . */ // release the lock exclusiveLock.release(); }catch (java.io.IOExceptionioe) { System.err.println(ioe); }finally { if (exclusiveLock != null) exclusiveLock.release(); if (sharedLock != null) sharedLock.release(); } } }

  11. File Types – Name, Extension

  12. Access Methods • Sequential Access read next write next reset no read after last write (rewrite) • Direct Access read n write n position to n read next write next rewrite n n = relative block number

  13. Sequential-access File

  14. Simulation of Sequential Access on a Direct-access File

  15. Example of Index and Relative Files

  16. សូមអរគុណចំពោះការយកចិត្តទុកដាក់!សូមអរគុណចំពោះការយកចិត្តទុកដាក់!

More Related