zoukankan      html  css  js  c++  java
  • 文件IO(2)

         Lseek:

         

    ***************************************************************************

       实验一:

       使用参数SEEK_SET,据darren.txt文件的开始8字节进行读取

       

       

       执行效果:

       

      (1)创建并写入buf中的内容到darren.txt文件中:

       

      (2)据darren.txt文件的开始8字节进行读取的8字节数据是“activity”

       

    ****************************************************************************  

      实验二:

      使用参数SEEK_CUR,据darren.txt文件的当前值+9

      

      

      执行结果:

      当前值 + 9byte 读取4字节是"dose"

      

    **************************************************************************** 

      实验三:

      使用参数SEEK_END,据darren.txt文件末尾+2 ,写入buf中的内容

      

      

      执行结果:

      

      

  • 相关阅读:
    php判断远程图片是否防盗链
    php获取远程图片url生成缩略图的方法
    qq zone g_tk
    zend studio aptana
    qq音乐接口
    function https_request
    Eclipse 汉化
    php 邮箱替换*
    获取顶级域名函数
    weixin oauth api 使用
  • 原文地址:https://www.cnblogs.com/darren-pty/p/darren_liunx_io.html
Copyright © 2011-2022 走看看