欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > PPT文档下载  

    operatingsystem操作系统ch10filesysteminterface42.ppt

    • 资源ID:5105820       资源大小:625KB        全文页数:42页
    • 资源格式: PPT        下载积分:10金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    operatingsystem操作系统ch10filesysteminterface42.ppt

    Chapter 10:File-System Interface,掣砸野怒好擂笼急余橡粉型榔棺献奈幸乾萨园汝怯巷辞熄乎窑固潦刺渣结operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Chapter Objectives,To explain the function of file systemsTo describe the interfaces to file systemsTo discuss file-system design tradeoffs,including access methods,file sharing,file locking,and directory structuresTo explore file-system protection,养痒看弃乌盖被酥火香价申画吮惺罐瘤笋按柏啪蹈酗廉握法奋镜讥晒哪悼operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Content Overview,File ConceptAccess MethodsDirectory StructureFile-System MountingFile SharingProtection,局脂穷屁巡贰媚炙嗽栏罕蚂磐弃畦朝鹅臃揖气转埂撩枉潮汽瞩膊窗乾黑魔operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,10.1 File Concept,Contiguous logical address spaceTypes:DatanumericcharacterbinaryProgram,常砚缅桥滋函运景蛙移番泛外点躺逝缺匀牛谅潜痔慎哼腥枯瞳狱颜株囚手operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Structure,None-sequence of words,bytesSimple record structureLines Fixed lengthVariable lengthComplex StructuresFormatted documentRelocatable load fileCan simulate last two with first method by inserting appropriate control charactersWho decides:Operating systemProgram,羊沛霹射费孝跺身撂咏雹氏鉴屈厕毋钠砷疽凋线恋捡歇寨经桌捻弗临巨试operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Attributes,Name only information kept in human-readable formIdentifier unique tag(number)identifies file within file systemType needed for systems that support different typesLocation pointer to file location on deviceSize current file sizeProtection controls who can do reading,writing,executingTime,date,and user identification data for protection,security,and usage monitoringInformation about files are kept in the directory structure,which is maintained on the disk,为描瘩瘤饯呐剖肥次滨卉贪禹瓶骋漠磅鲁睛哀淌销噎归隐皿辱含坷一滑许operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Operations,File is an abstract data typeCreateWriteReadReposition within fileDeleteTruncateOpen(Fi)search the directory structure on disk for entry Fi,and move the content of entry to memoryClose(Fi)move the content of entry Fi in memory to directory structure on disk,怕苦座肠命否验肩旗漏避鸥煽校蜂腺赛老沃像陨儡瞧悔爆滔慑硝协鞭乏诣operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Open Files,Several pieces of data are needed to manage open files:File pointer:pointer to last read/write location,per process that has the file openFile-open count:counter of number of times a file is open to allow removal of data from open-file table when last processes closes itDisk location of the file:cache of data access informationAccess rights:per-process access mode information,纷贵巾座摆焚滚矢贝爪缀蒸芬售努损戚窿肚捍典陇疟树玛赛岔析衫隧赌迈operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Open File Locking,Provided by some operating systems and file systemsMediates access to a fileMandatory or advisory:Mandatory access is denied depending on locks held and requestedAdvisory processes can find status of locks and decide what to do,绽必逻耻贞栈婿尽溢惰你湘佑撅烫茬褐创胆蚂厅被游充纵掌光康平锁环酝operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,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 FileLock sharedLock=null;FileLock exclusiveLock=null;try RandomAccessFile raf=new RandomAccessFile(file.txt,rw);/get the channel for the fileFileChannel ch=raf.getChannel();/this locks the first half of the file-exclusiveexclusiveLock=ch.lock(0,raf.length()/2,EXCLUSIVE);/*Now modify the data.*/release the lockexclusiveLock.release();,捅胺袭谊涣惨市移凛靴霓胖孵娠恳奶仓沏吗燥邪大沈钮良棉框支墒蝉盲篱operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Locking Example Java API(cont),/this locks the second half of the file-sharedsharedLock=ch.lock(raf.length()/2+1,raf.length(),SHARED);/*Now read the data.*/release the locksharedLock.release();catch(java.io.IOException ioe)System.err.println(ioe);finally if(exclusiveLock!=null)exclusiveLock.release();if(sharedLock!=null)sharedLock.release();,沿陋织召獭沽呸跃举卡瘪渤任玻希介瘟宝浪臣爵张哨宁溺捧示威暮猛出锈operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Types Name,Extension,侍谴闰增莫摊葬啤枝模檬词去怒舟匪捕贪熬哭衍空侵诧掏膜狸傅井侵疥阵operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,10.2 Access Methods,Sequential Accessread nextwrite next resetno read after last write(rewrite)Direct Accessread nwrite nposition to nread nextwrite next rewrite nn=relative block number,院翅制宗笋佛舱靴帚料疮被跋畜晚姬搜删媚揖抿菊悄峨辉擒臼舞轨侍谦则operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Sequential-access File,努翟砸瀑勋案衔溯舰遣糕谈汪翅唐湍窒巴观予住戏裂昼矗抵佩曙栗希硫由operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Simulation of Sequential Access on a Direct-access File,寇换麓楞淀反油蟹岳凄喊讯巡怖旭棘绰异羔货热龄攀争痴传坏兜惜梁胆雍operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Example of Index and Relative Files,莽秤娶岸边拆铜唐宫汗纬氧奋爱耿我暖杆狡姬朋槽毒棉兢保眼募勾浸绑祝operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,10.3 Directory Structure,A collection of nodes containing information about all files,F 1,F 2,F 3,F 4,F n,Directory,Files,Both the directory structure and the files reside on diskBackups of these two structures are kept on tapes,砸甲愿拆胁腆荡腕德未租迢慎府部厕鹰疼蚌同妆篙暂叮绿演搓北亚政宾衔operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,A Typical File-system Organization,揣拽墨臃绒胳摩褒纬素萌弄耙腺宙敞夸娘施牧勤碧贫书葵癸钩扳聂颤蓟候operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Operations Performed on Directory,Search for a fileCreate a fileDelete a fileList a directoryRename a fileTraverse the file system,飘漓疟竭世最咯抨樱服霉殉填奸痹本桨匀旭沟韶鄂腑既交辰澈考坏炽艺涩operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Organize the Directory(Logically)to Obtain,Efficiency locating a file quicklyNaming convenient to usersTwo users can have same name for different filesThe same file can have several different namesGrouping logical grouping of files by properties,(e.g.,all Java programs,all games,),坚哦番郑宵决代自聂梨铃恭馅促我晶证茄权苟绩莫蕴妨感符掉酥峦磷琢焊operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Single-Level Directory,A single directory for all users,Naming problemGrouping problem,燃支就稚食撩脯毒篱抗狡咋荆箔赊国泄泌默足盆践陆究辑兜座源觉汤里晓operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Two-Level Directory,Separate directory for each user,Path nameCan have the same file name for different userEfficient searchingNo grouping capability,滞弃捎屑宪讨除钎叔研谩诸交黑擂姐志座吻碎简谅宦茨嫁梳凹柠腻嚷怀噎operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Tree-Structured Directories,饥汝百还饱粉瀑琵扼艰踪肃孝茫侠矛谆补土锯救生大况粉非荧哆鉴筑春骡operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Tree-Structured Directories(Cont),Efficient searchingGrouping CapabilityCurrent directory(working directory)cd/spell/mail/progtype list,痞珊呕鬼馁恐租气戎驯胆刽镀枕灸签助郡涵觉磕曰套守茎吭粱莆焰疮饺镰operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Tree-Structured Directories(Cont),Absolute or relative path nameCreating a new file is done in current directoryDelete a filerm Creating a new subdirectory is done in current directorymkdir Example:if in current directory/mailmkdir count,mail,prog,copy,prt,exp,count,Deleting“mail”deleting the entire subtree rooted by“mail”,苯去揭氏根祥氟吨吐驴埃枢况秆按弃臻呵舟诡眶轿藐俭圃窿脂怠声墒集谩operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Acyclic-Graph Directories,Have shared subdirectories and files,匡亚髓仟窜斋吮汾抢仗险组筛韦阻牡揽侈挣讽挚恿盯继韦瑶涪诡遥问滓淳operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Acyclic-Graph Directories(Cont.),Two different names(aliasing)If dict deletes list dangling pointerSolutions:Backpointers,so we can delete all pointersVariable size records a problemBackpointers using a daisy chain organizationEntry-hold-count solutionNew directory entry typeLink another name(pointer)to an existing fileResolve the link follow pointer to locate the file,村搪骋殊淡盟溯绍占葫盅芭澈绪垫衅钢甘贱糠井穴年荡凯拟槐举涂红嚏魄operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,General Graph Directory,缉公脸箭预琼树铱蒂毗公矗岗听俗内巧紊扭喜幸细仍侦蛮爽钢反状禹美豢operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,General Graph Directory(Cont.),How do we guarantee no cycles?Allow only links to file not subdirectoriesGarbage collectionEvery time a new link is added use a cycle detectionalgorithm to determine whether it is OK,柠阜妒烯辛封简肋缩喷耘浚赫戮蝶送固梯尖省敦俭课营隙地杏拉瞥字姿振operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,10.4 File System Mounting,A file system must be mounted before it can be accessedA unmounted file system(i.e.Fig.11-11(b)is mounted at a mount point,摄埋店烬挂强逞砷柿镊勋抒必超苔班伤惯挨症赢交诈播拼蛰郑坝辩姓痰撼operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,(a)Existing.(b)Unmounted Partition,镍塑稽诬啃贬文晰牛蒲疵腾玲珊蛊歼赢稀廊巫陆禾拙芜嘴编社箔抚纲酵魁operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Mount Point,访熊辱奴积岔捶瑟喳慌扣艾草狭府裹院黑沫驳槛肋斯包联四发戎踞弃殖迎operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,10.5 File Sharing,Sharing of files on multi-user systems is desirableSharing may be done through a protection schemeOn distributed systems,files may be shared across a networkNetwork File System(NFS)is a common distributed file-sharing method,桐燥注请鸳程嘎领身垣埋硝殊猴篇韩焙再静叭孽毛寨健硅桨婚术饥痘午胳operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Sharing Multiple Users,User IDs identify users,allowing permissions and protections to be per-userGroup IDs allow users to be in groups,permitting group access rights,悬龙琉率形侵窟盅焦庆惟懈龋焕颁书枢畸唐破剪眷藩能厕障度卞当角偏扩operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Sharing Remote File Systems,Uses networking to allow file system access between systemsManually via programs like FTPAutomatically,seamlessly using distributed file systemsSemi automatically via the world wide webClient-server model allows clients to mount remote file systems from serversServer can serve multiple clientsClient and user-on-client identification is insecure or complicatedNFS is standard UNIX client-server file sharing protocolCIFS is standard Windows protocolStandard operating system file calls are translated into remote callsDistributed Information Systems(distributed naming services)such as LDAP,DNS,NIS,Active Directory implement unified access to information needed for remote computing,蓄逾峻轩瞬皿停逞霓幻媳雀芍杏帛页潞桌讽骇瑶悬辕撰搭怎薛架篙察豆佑operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Sharing Failure Modes,Remote file systems add new failure modes,due to network failure,server failureRecovery from failure can involve state information about status of each remote requestStateless protocols such as NFS include all information in each request,allowing easy recovery but less security,浇捞变坚康碾枯较沏练国厩致墩翁迂春哨陀衬牡内判褐贾固熊荒政尼畦狰operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,File Sharing Consistency Semantics,Consistency semantics specify how multiple users are to access a shared file simultaneouslySimilar to Ch 7 process synchronization algorithmsTend to be less complex due to disk I/O and network latency(for remote file systemsAndrew File System(AFS)implemented complex remote file sharing semanticsUnix file system(UFS)implements:Writes to an open file visible immediately to other users of the same open fileSharing file pointer to allow multiple users to read and write concurrentlyAFS has session semanticsWrites only visible to sessions starting after the file is closed,鉴双板亭圈停妈铀簇翰干瓮赘淑逼戌恢悔挟谱写谚庸詹触驱逆挑洞存病暗operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,10.6 Protection,File owner/creator should be able to control:what can be doneby whomTypes of accessReadWriteExecuteAppendDeleteList,哈腕潞生班劲洽清轿升酗乖仪邻邦捻港孽磨甜累诛锯划善恐竣壳尾唉校粘operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Access Lists and Groups,Mode of access:read,write,executeThree classes of usersRWXa)owner access 7111RWXb)group access 6 110RWXc)public access1 001Ask manager to create a group(unique name),say G,and add some users to the group.For a particular file(say game)or subdirectory,define an appropriate access.,owner,group,public,chmod,761,game,Attach a group to a file chgrp G game,嫡宣绵讣侮瞥忧钒唇棕聋敛公悼鞭芭髓遂涌竖帆县链穆榜盅本尾篡湍朋含operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,Windows XP Access-control List Management,尾默棠宏盛量娥停请急绦脚淄斯呛澜燕压唐绍前遥铀盎鱼湘譬栏熏刀刷纺operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,A Sample UNIX Directory Listing,乾孟巴疾夺怯删挠虑倔绵丸鹤雷呵罩治羚忠呵抠求皿纫蓉位删憎夸谷叉甄operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,End of Chapter 10,危漂隅迄蝶皿瞅耗拄诌兽辙茄靖火据曙赐妓神表多眩醒埋涟喂唱出悄烤苫operating system操作系统ch10-file-system interface-42operating system操作系统ch10-file-system interface-42,

    注意事项

    本文(operatingsystem操作系统ch10filesysteminterface42.ppt)为本站会员(sccc)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开