Subversion Repositories Kolibri OS

Rev

Rev 2570 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;================================================================================================;;
  2. ;;//// libio.asm //// (c) mike.dld, 2006-2008 ////////////////////////////////////////////////////;;
  3. ;;================================================================================================;;
  4. ;;                                                                                                ;;
  5. ;; This file is part of Common development libraries (Libs-Dev).                                  ;;
  6. ;;                                                                                                ;;
  7. ;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
  8. ;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
  9. ;; of the License, or (at your option) any later version.                                         ;;
  10. ;;                                                                                                ;;
  11. ;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  ;;
  12. ;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  ;;
  13. ;; Lesser General Public License for more details.                                                ;;
  14. ;;                                                                                                ;;
  15. ;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev.  ;;
  16. ;; If not, see <http://www.gnu.org/licenses/>.                                                    ;;
  17. ;;                                                                                                ;;
  18. ;;================================================================================================;;
  19. ;;                                                                                                ;;
  20. ;; 2008-08-06 (mike.dld)                                                                          ;;
  21. ;;   changes:                                                                                     ;;
  22. ;;     - split private procs into libio_p.asm, added comments                                     ;;
  23. ;; 2007-12-10 (mike.dld)                                                                          ;;
  24. ;;   changes:                                                                                     ;;
  25. ;;     - almost fully incompatible with previous version since return values were changed.        ;;
  26. ;;       now they are more C-like                                                                 ;;
  27. ;;   notes:                                                                                       ;;
  28. ;;     - `file.err` is not yet available                                                          ;;
  29. ;; 2007-09-26 (mike.dld)                                                                          ;;
  30. ;;   changes:                                                                                     ;;
  31. ;;     - modified `file.size` a bit (according to changes in FileInfo struct)                     ;;
  32. ;;     - added `file.find_first`, `file.find_next`, `file.find_close`                             ;;
  33. ;;   notes:                                                                                       ;;
  34. ;;     - `file.aux.match_wildcard` is exported only for testing purposes, don't                   ;;
  35. ;;       use it since it may be removed or renamed in next versions                               ;;
  36. ;;                                                                                                ;;
  37. ;;================================================================================================;;
  38.  
  39.  
  40.  
  41. format MS COFF
  42.  
  43. public @EXPORT as 'EXPORTS'
  44.  
  45. include '../../../../proc32.inc'
  46. include '../../../../macros.inc'
  47. purge section,mov,add,sub
  48.  
  49. include 'libio.inc'
  50. include 'libio_p.inc'
  51.  
  52. section '.flat' code readable align 16
  53.  
  54. include 'libio_p.asm'
  55.  
  56. ;;================================================================================================;;
  57. proc file.find_first _dir, _mask, _attr ;/////////////////////////////////////////////////////////;;
  58. ;;------------------------------------------------------------------------------------------------;;
  59. ;? Find first file with matching attributes and mask in specified directory                       ;;
  60. ;;------------------------------------------------------------------------------------------------;;
  61. ;> _dir = directory path to search in <asciiz>                                                    ;;
  62. ;> _mask = file mask, with use of wildcards <asciiz>                                              ;;
  63. ;> _attr = file attributes mask (combination of FA_* constants) <dword>                           ;;
  64. ;;------------------------------------------------------------------------------------------------;;
  65. ;< eax = 0 (error) / matched file data pointer (acts as find descriptor) <FileInfo*>              ;;
  66. ;;================================================================================================;;
  67.         push    ebx edx
  68.  
  69.         invoke  mem.alloc, sizeof.FindFileBlock
  70.         or      eax, eax
  71.         jz      .exit.error
  72.         mov     edx, eax
  73.         mov     ebx, [_attr]
  74.         mov     [edx + FindFileBlock.Options.Attributes], ebx
  75.         mov     ebx, [_mask]
  76.         mov     [edx + FindFileBlock.Options.Mask], ebx
  77.  
  78.         lea     ebx, [edx + FindFileBlock.InfoBlock]
  79.         mov     [ebx + FileInfoBlock.Function], F70_READ_D
  80.         mov     [ebx + FileInfoBlock.Count], 1
  81.         lea     eax, [edx + FindFileBlock.Header]
  82.         mov     [ebx + FileInfoBlock.Buffer], eax
  83.         mov     eax, [_dir]
  84.         mov     [ebx + FileInfoBlock.FileName], eax
  85.  
  86.         stdcall libio._.find_matching_file, edx
  87.         pop     edx ebx
  88.         ret
  89.  
  90.   .exit.error:
  91.         xor     eax, eax
  92.         pop     edx ebx
  93.         ret
  94. endp
  95.  
  96. ;;================================================================================================;;
  97. proc file.find_next _findd ;//////////////////////////////////////////////////////////////////////;;
  98. ;;------------------------------------------------------------------------------------------------;;
  99. ;? Find next file matching criteria                                                               ;;
  100. ;;------------------------------------------------------------------------------------------------;;
  101. ;> _findd = find descriptor (see `file.find_first`) <FileInfo*>                                   ;;
  102. ;;------------------------------------------------------------------------------------------------;;
  103. ;< eax = 0 (error) / matched file data pointer (acts as find descriptor) <FileInfo*>              ;;
  104. ;;================================================================================================;;
  105.         mov     eax, [_findd]
  106.         add     eax, -sizeof.FileInfoHeader
  107.         inc     [eax + FindFileBlock.InfoBlock.Position]
  108.         stdcall libio._.find_matching_file, eax
  109.         ret
  110. endp
  111.  
  112. ;;================================================================================================;;
  113. proc file.find_close _findd ;/////////////////////////////////////////////////////////////////////;;
  114. ;;------------------------------------------------------------------------------------------------;;
  115. ;? Close find descriptor and free memory                                                          ;;
  116. ;;------------------------------------------------------------------------------------------------;;
  117. ;> _findd = find descriptor (see `file.find_first`) <FileInfo*>                                   ;;
  118. ;;------------------------------------------------------------------------------------------------;;
  119. ;< eax = result of memory freeing routine                                                         ;;
  120. ;;================================================================================================;;
  121.         mov     eax, [_findd]
  122.         add     eax, -sizeof.FileInfoHeader
  123.         invoke  mem.free, eax
  124.         ret
  125. endp
  126.  
  127. ;;================================================================================================;;
  128. proc file.size _name ;////////////////////////////////////////////////////////////////////////////;;
  129. ;;------------------------------------------------------------------------------------------------;;
  130. ;? Get file size                                                                                  ;;
  131. ;;------------------------------------------------------------------------------------------------;;
  132. ;> _name = path to file (full or relative) <asciiz>                                               ;;
  133. ;;------------------------------------------------------------------------------------------------;;
  134. ;< ebx = -1 (error) / file size (in bytes, up to 2G) <dword>                                      ;;
  135. ;;------------------------------------------------------------------------------------------------;;
  136. ;# call `file.err` to obtain extended error information                                           ;;
  137. ;;================================================================================================;;
  138. locals
  139.   loc_info FileInfoBlock
  140. endl
  141.  
  142.         lea     ebx, [loc_info]
  143.         invoke  mem.alloc, 40
  144.         push    eax
  145.         mov     [ebx + FileInfoBlock.Function], F70_GETATTR_FD
  146.         mov     [ebx + FileInfoBlock.Buffer], eax
  147.         mov     byte[ebx + FileInfoBlock.FileName - 1], 0
  148.         mov     eax, [_name]
  149.         mov     [ebx + FileInfoBlock.FileName], eax
  150.         mcall   70
  151.         pop     ebx
  152.         push    eax
  153.         mov     eax, ebx
  154.         mov     ebx, [ebx + FileInfo.FileSizeLow]
  155.         invoke  mem.free, eax
  156.         pop     eax
  157.         ret
  158. endp
  159.  
  160. ;;================================================================================================;;
  161. proc file.open _name, _mode ;/////////////////////////////////////////////////////////////////////;;
  162. ;;------------------------------------------------------------------------------------------------;;
  163. ;? Open file                                                                                      ;;
  164. ;;------------------------------------------------------------------------------------------------;;
  165. ;> _name = path to file (full or relative) <asciiz>                                               ;;
  166. ;> _mode = mode to open file in (combination of O_* constants) <dword>                            ;;
  167. ;>   O_BINARY - don't change read/written data in any way (default)                               ;;
  168. ;>   O_READ - open file for reading                                                               ;;
  169. ;>   O_WRITE - open file for writing                                                              ;;
  170. ;>   O_CREATE - create file if it doesn't exist, open otherwise                                   ;;
  171. ;>   O_SHARE - allow simultaneous access by using different file descriptors (not implemented)    ;;
  172. ;>   O_TEXT - replace newline chars with LF (overrides O_BINARY, not implemented)                 ;;
  173. ;;------------------------------------------------------------------------------------------------;;
  174. ;< eax = 0 (error) / file descriptor <InternalFileInfo*>                                          ;;
  175. ;;------------------------------------------------------------------------------------------------;;
  176. ;# call `file.err` to obtain extended error information                                           ;;
  177. ;;================================================================================================;;
  178. locals
  179.   loc_info FileInfoBlock
  180.   loc_buf  rb 40
  181. endl
  182.  
  183.         push    ebx esi edi
  184.  
  185.         xor     ebx, ebx
  186.         invoke  mem.alloc, sizeof.InternalFileInfo
  187.         or      eax, eax
  188.         jz      .exit_error
  189.         mov     ebx, eax
  190.         push    [_mode]
  191.         pop     [ebx + InternalFileInfo.Mode]
  192.         mov     [ebx + InternalFileInfo.Position], 0
  193.         lea     edi, [ebx + InternalFileInfo.FileName]
  194.         mov     esi, [_name]
  195.         mov     ecx, 260 / 4
  196.         cld
  197.         rep     movsd
  198.  
  199.   .get_info:
  200.         push    ebx
  201.         mov     [loc_info.Function], F70_GETATTR_FD
  202.         lea     eax, [loc_buf]
  203.         mov     [loc_info.Buffer], eax
  204.         mov     byte[loc_info.FileName - 1], 0
  205.         mov     eax, [_name]
  206.         mov     [loc_info.FileName], eax
  207.         lea     ebx, [loc_info]
  208.         mcall   70
  209.         pop     ebx
  210.         or      eax, eax
  211.         jz      @f
  212.         cmp     eax, 6
  213.         jne     .exit_error.ex
  214.     @@:
  215.         mov     eax, ebx
  216.         pop     edi esi ebx
  217.         ret
  218.  
  219.   .exit_error.ex:
  220.         test    [_mode], O_CREATE
  221.         jz      .exit_error
  222.         push    ebx
  223.         mov     [loc_info.Function], F70_CREATE_F
  224.         xor     eax, eax
  225.         mov     [loc_info.Position], eax
  226.         mov     [loc_info.Flags], eax
  227.         mov     [loc_info.Count], eax
  228.         lea     ebx, [loc_info]
  229.         mcall   70
  230.         pop     ebx
  231.         or      eax, eax
  232.         jz      .get_info
  233.  
  234.   .exit_error:
  235.         invoke  mem.free, ebx
  236.         xor     eax, eax
  237.         pop     edi esi ebx
  238.         ret
  239. endp
  240.  
  241. ;;================================================================================================;;
  242. proc file.read _filed, _buf, _buflen ;////////////////////////////////////////////////////////////;;
  243. ;;------------------------------------------------------------------------------------------------;;
  244. ;? Read data from file                                                                            ;;
  245. ;;------------------------------------------------------------------------------------------------;;
  246. ;> _filed = file descriptor (see `file.open`) <InternalFileInfo*>                                 ;;
  247. ;> _buf = buffer to put read data to <byte*>                                                      ;;
  248. ;> _buflen = buffer size (number of bytes to be read from file) <dword>                           ;;
  249. ;;------------------------------------------------------------------------------------------------;;
  250. ;< eax = -1 (error) / number of bytes read <dword>                                                ;;
  251. ;;------------------------------------------------------------------------------------------------;;
  252. ;# call `file.err` to obtain extended error information                                           ;;
  253. ;;================================================================================================;;
  254. locals
  255.   loc_info FileInfoBlock
  256. endl
  257.  
  258.         push    ebx esi edi
  259.  
  260.         mov     ebx, [_filed]
  261.         test    [ebx + InternalFileInfo.Mode], O_READ
  262.         jz      .exit_error
  263.  
  264.         xor     eax, eax
  265.         mov     [loc_info.Function], F70_READ_F
  266.         mov     [loc_info.Flags], eax
  267.         mov     byte[loc_info.FileName - 1], al
  268.         push    [ebx+InternalFileInfo.Position] [_buflen] [_buf]
  269.         pop     [loc_info.Buffer] [loc_info.Count] [loc_info.Position]
  270.         lea     eax, [ebx + InternalFileInfo.FileName]
  271.         mov     [loc_info.FileName], eax
  272.         lea     ebx, [loc_info]
  273.         mcall   70
  274.         or      eax, eax
  275.         jz      @f
  276.         cmp     eax, 6
  277.         jne     .exit_error
  278.     @@:
  279.         mov     eax, ebx
  280.         mov     ebx, [_filed]
  281.         add     [ebx + InternalFileInfo.Position], eax
  282.         pop     edi esi ebx
  283.         ret
  284.  
  285.   .exit_error:
  286.         or      eax, -1
  287.         pop     edi esi ebx
  288.         ret
  289. endp
  290.  
  291. ;;================================================================================================;;
  292. proc file.write _filed, _buf, _buflen ;///////////////////////////////////////////////////////////;;
  293. ;;------------------------------------------------------------------------------------------------;;
  294. ;? Write data to file                                                                             ;;
  295. ;;------------------------------------------------------------------------------------------------;;
  296. ;> _filed = file descriptor (see `file.open`) <InternalFileInfo*>                                 ;;
  297. ;> _buf = buffer to get write data from <byte*>                                                   ;;
  298. ;> _buflen = buffer size (number of bytes to be written to file) <dword>                          ;;
  299. ;;------------------------------------------------------------------------------------------------;;
  300. ;< eax = -1 (error) / number of bytes written <dword>                                             ;;
  301. ;;------------------------------------------------------------------------------------------------;;
  302. ;# call `file.err` to obtain extended error information                                           ;;
  303. ;;================================================================================================;;
  304. locals
  305.   loc_info FileInfoBlock
  306. endl
  307.  
  308.         push    ebx esi edi
  309.  
  310.         mov     ebx, [_filed]
  311.         test    [ebx + InternalFileInfo.Mode], O_WRITE
  312.         jz      .exit_error
  313.  
  314.         stdcall file.eof?, [_filed]
  315.         or      eax, eax
  316.         js      .exit_error
  317.         jz      @f
  318.         stdcall file.truncate, [_filed]
  319.     @@:
  320.         mov     [loc_info.Function], F70_WRITE_F
  321.         xor     eax, eax
  322.         mov     [loc_info.Flags], eax
  323.         mov     byte[loc_info.FileName - 1], al
  324.         push    [ebx + InternalFileInfo.Position] [_buflen] [_buf]
  325.         pop     [loc_info.Buffer] [loc_info.Count] [loc_info.Position]
  326.         lea     eax, [ebx + InternalFileInfo.FileName]
  327.         mov     [loc_info.FileName], eax
  328.         lea     ebx, [loc_info]
  329.         mcall   70
  330.         or      eax, eax
  331.         jnz     .exit_error
  332.     @@:
  333.         mov     eax, ebx
  334.         mov     ebx, [_filed]
  335.         add     [ebx + InternalFileInfo.Position],eax
  336.         pop     edi esi ebx
  337.         ret
  338.  
  339.   .exit_error:
  340.         or      eax, -1
  341.         pop     edi esi ebx
  342.         ret
  343. endp
  344.  
  345. ;;================================================================================================;;
  346. proc file.seek _filed, _where, _origin ;//////////////////////////////////////////////////////////;;
  347. ;;------------------------------------------------------------------------------------------------;;
  348. ;? Set file pointer position                                                                      ;;
  349. ;;------------------------------------------------------------------------------------------------;;
  350. ;> _filed = file descriptor (see `file.open`) <InternalFileInfo*>                                 ;;
  351. ;> _where = position in file (in bytes) counted from specified origin <dword>                     ;;
  352. ;> _origin = origin from where to set the position (one of SEEK_* constants) <dword>              ;;
  353. ;>   SEEK_SET - from beginning of file                                                            ;;
  354. ;>   SEEK_CUR - from current pointer position                                                     ;;
  355. ;>   SEEK_END - from end of file                                                                  ;;
  356. ;;------------------------------------------------------------------------------------------------;;
  357. ;< eax = -1 (error) / 0 <dword>                                                                   ;;
  358. ;;------------------------------------------------------------------------------------------------;;
  359. ;# call `file.err` to obtain extended error information                                           ;;
  360. ;;================================================================================================;;
  361.         push    ebx ecx edx
  362.  
  363.         mov     ecx, [_filed]
  364.         lea     eax, [ecx + InternalFileInfo.FileName]
  365.         stdcall file.size, eax
  366.         or      eax, eax
  367.         jnz     .exit_error
  368.         mov     edx, [_where]
  369.         cmp     [_origin], SEEK_SET
  370.         jne     .n_set
  371.         mov     [ecx + InternalFileInfo.Position], edx
  372.         jmp     .exit_ok
  373.  
  374.   .n_set:
  375.         cmp     [_origin], SEEK_CUR
  376.         jne     .n_cur
  377.         add     [ecx + InternalFileInfo.Position], edx
  378.         jmp     .exit_ok
  379.  
  380.   .n_cur:
  381.         cmp     [_origin], SEEK_END
  382.         jne     .exit_error
  383.         neg     edx
  384.         add     edx, ebx
  385.         mov     [ecx + InternalFileInfo.Position], edx
  386.  
  387.   .exit_ok:
  388.  
  389.         cmp     [ecx + InternalFileInfo.Position], 0
  390.         jge     @f
  391.         mov     [ecx + InternalFileInfo.Position], 0
  392.     @@:
  393. ;       cmp     ebx, [ecx+InternalFileInfo.Position]
  394. ;       jae     @f
  395. ;       mov     [ecx + InternalFileInfo.Position], ebx
  396. ;   @@:
  397.         xor     eax, eax
  398.         pop     edx ecx ebx
  399.         ret
  400.  
  401.   .exit_error:
  402.         or      eax, -1
  403.         pop     edx ecx ebx
  404.         ret
  405. endp
  406.  
  407. ;;================================================================================================;;
  408. proc file.eof? _filed ;///////////////////////////////////////////////////////////////////////////;;
  409. ;;------------------------------------------------------------------------------------------------;;
  410. ;? Determine if file pointer is at the end of file                                                ;;
  411. ;;------------------------------------------------------------------------------------------------;;
  412. ;> _filed = file descriptor (see `file.open`) <InternalFileInfo*>                                 ;;
  413. ;;------------------------------------------------------------------------------------------------;;
  414. ;< eax = false / true <dword>                                                                     ;;
  415. ;;------------------------------------------------------------------------------------------------;;
  416. ;# call `file.err` to obtain extended error information                                           ;;
  417. ;;================================================================================================;;
  418.         push    ebx ecx
  419.  
  420.         mov     ecx, [_filed]
  421.         lea     eax, [ecx + InternalFileInfo.FileName]
  422.         stdcall file.size, eax
  423.         or      eax, eax
  424.         jnz     .exit_error
  425.  
  426.         xor     eax, eax
  427.         cmp     [ecx + InternalFileInfo.Position], ebx
  428.         jb      @f
  429.         inc     eax
  430.     @@: pop     ecx ebx
  431.         ret
  432.  
  433.   .exit_error:
  434.         or      eax, -1
  435.         pop     ecx ebx
  436.         ret
  437. endp
  438.  
  439. ;;================================================================================================;;
  440. proc file.truncate _filed ;///////////////////////////////////////////////////////////////////////;;
  441. ;;------------------------------------------------------------------------------------------------;;
  442. ;? Truncate file size to current file pointer position                                            ;;
  443. ;;------------------------------------------------------------------------------------------------;;
  444. ;> _filed = file descriptor (see `file.open`) <InternalFileInfo*>                                 ;;
  445. ;;------------------------------------------------------------------------------------------------;;
  446. ;< eax = -1 (error) / 0 <dword>                                                                   ;;
  447. ;;------------------------------------------------------------------------------------------------;;
  448. ;# call `file.err` to obtain extended error information                                           ;;
  449. ;;================================================================================================;;
  450. locals
  451.   loc_info FileInfoBlock
  452. endl
  453.  
  454.         push    ebx esi edi
  455.  
  456.         mov     ebx, [_filed]
  457.         test    [ebx + InternalFileInfo.Mode], O_WRITE
  458.         jz      .exit_error
  459.  
  460.         mov     [loc_info.Function], F70_SETSIZE_F
  461.         mov     eax, [ebx + InternalFileInfo.Position]
  462.         mov     [loc_info.Position], eax
  463.         xor     eax, eax
  464.         mov     [loc_info.Flags], eax
  465.         mov     [loc_info.Count], eax
  466.         mov     [loc_info.Buffer], eax
  467.         mov     byte[loc_info.FileName - 1], al
  468.         lea     eax, [ebx + InternalFileInfo.FileName]
  469.         mov     [loc_info.FileName], eax
  470.         lea     ebx, [loc_info]
  471.         mcall   70
  472.         cmp     eax, 2
  473.         je      .exit_error
  474.         cmp     eax, 8
  475.         je      .exit_error
  476.     @@: xor     eax, eax
  477.         pop     edi esi ebx
  478.         ret
  479.  
  480.   .exit_error:
  481.         or      eax, -1
  482.         pop     edi esi ebx
  483.         ret
  484. endp
  485.  
  486. file.seteof equ file.truncate
  487.  
  488. ;;================================================================================================;;
  489. proc file.tell _filed ;///////////////////////////////////////////////////////////////////////////;;
  490. ;;------------------------------------------------------------------------------------------------;;
  491. ;? Get current file pointer position                                                              ;;
  492. ;;------------------------------------------------------------------------------------------------;;
  493. ;> _filed = file descriptor (see `file.open`) <InternalFileInfo*>                                 ;;
  494. ;;------------------------------------------------------------------------------------------------;;
  495. ;< eax = -1 (error) / file pointer position <dword>                                               ;;
  496. ;;------------------------------------------------------------------------------------------------;;
  497. ;# call `file.err` to obtain extended error information                                           ;;
  498. ;;================================================================================================;;
  499.         mov     eax, [_filed]
  500.         mov     eax, [eax + InternalFileInfo.Position]
  501.         ret
  502. endp
  503.  
  504. ;;================================================================================================;;
  505. proc file.close _filed ;//////////////////////////////////////////////////////////////////////////;;
  506. ;;------------------------------------------------------------------------------------------------;;
  507. ;? Close file                                                                                     ;;
  508. ;;------------------------------------------------------------------------------------------------;;
  509. ;> _filed = file descriptor (see `file.open`) <InternalFileInfo*>                                 ;;
  510. ;;------------------------------------------------------------------------------------------------;;
  511. ;< eax = -1 (error) / file pointer position <dword>                                               ;;
  512. ;;------------------------------------------------------------------------------------------------;;
  513. ;# call `file.err` to obtain extended error information                                           ;;
  514. ;;================================================================================================;;
  515.         cmp eax,32
  516.         jb .exit_error
  517.         mov     eax, [_filed]
  518.         mov     [eax + InternalFileInfo.Mode], 0
  519.         mov     [eax + InternalFileInfo.FileName], 0
  520.         invoke  mem.free, eax
  521.         xor     eax, eax
  522.         jmp @f
  523.         .exit_error:
  524.         or      eax, -1
  525.         @@:
  526.         ret
  527. endp
  528.  
  529.  
  530. ;;================================================================================================;;
  531. ;;////////////////////////////////////////////////////////////////////////////////////////////////;;
  532. ;;================================================================================================;;
  533. ;! Exported functions section                                                                     ;;
  534. ;;================================================================================================;;
  535. ;;////////////////////////////////////////////////////////////////////////////////////////////////;;
  536. ;;================================================================================================;;
  537.  
  538.  
  539. align 16
  540. @EXPORT:
  541.  
  542. export                                        \
  543.         libio._.init    , 'lib_init'        , \
  544.         0x00040004      , 'version'         , \
  545.         file.find_first , 'file_find_first' , \
  546.         file.find_next  , 'file_find_next'  , \
  547.         file.find_close , 'file_find_close' , \
  548.         file.size       , 'file_size'       , \
  549.         file.open       , 'file_open'       , \
  550.         file.read       , 'file_read'       , \
  551.         file.write      , 'file_write'      , \
  552.         file.seek       , 'file_seek'       , \
  553.         file.tell       , 'file_tell'       , \
  554.         file.eof?       , 'file_iseof'      , \
  555.         file.seteof     , 'file_seteof'     , \
  556.         file.truncate   , 'file_truncate'   , \
  557.         file.close      , 'file_close'
  558.  
  559.