home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / harbb30g.zip / INCLUDE / fileio.ch < prev    next >
Text File  |  1999-09-15  |  4KB  |  101 lines

  1. /*
  2.  * $Id: fileio.ch,v 1.11 1999/09/15 14:03:36 vszel Exp $
  3.  */
  4.  
  5. /*
  6.  * Harbour Project source code:
  7.  * Header file for file management functions
  8.  *
  9.  * Copyright 1999 David G. Holm <dholm@jsd-llc.com>
  10.  * www - http://www.harbour-project.org
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version, with one exception:
  16.  *
  17.  * The exception is that if you link the Harbour Runtime Library (HRL)
  18.  * and/or the Harbour Virtual Machine (HVM) with other files to produce
  19.  * an executable, this does not by itself cause the resulting executable
  20.  * to be covered by the GNU General Public License. Your use of that
  21.  * executable is in no way restricted on account of linking the HRL
  22.  * and/or HVM code into it.
  23.  *
  24.  * This program is distributed in the hope that it will be useful,
  25.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  * GNU General Public License for more details.
  28.  *
  29.  * You should have received a copy of the GNU General Public License
  30.  * along with this program; if not, write to the Free Software
  31.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
  32.  * their web site at http://www.gnu.org/).
  33.  *
  34.  */
  35.  
  36. /*
  37.  * ChangeLog:
  38.  *
  39.  * V 1.5    David G. Holm               Added my email address.
  40.  * V 1.4    David G. Holm               Added copyright and license header,
  41.  *                                      along with a complete version history.
  42.  * V 1.3    Victor Szel                 Undocumented change.
  43.  * V 1.2    David G. Holm               Corrected RCS Id keyword.
  44.  * V 1.1    David G. Holm               Committed to CVS.
  45.  * V 1.0    David G. Holm               Initial version.
  46.  *
  47.  */
  48.  
  49. /* NOTE: This file is also used by C code. */
  50.  
  51. #ifndef _FILEIO_CH
  52. #define _FILEIO_CH
  53.  
  54. /* File create flags */
  55. #define FC_NORMAL     0x0000   /* No file attributes are set      */
  56. #define FC_READONLY   0x0001   /* Read-only file attribute is set */
  57. #define FC_HIDDEN     0x0002   /* Hidden file attribute is set    */
  58. #define FC_SYSTEM     0x0004   /* System file attribute is set    */
  59.  
  60. /* File locking flags */
  61. #define FL_LOCK       0x0000   /* Lock a region   */
  62. #define FL_UNLOCK     0x0001   /* Unlock a region */
  63.  
  64. /* File access flags */
  65. #define FO_READ       0x0000   /* File is opened for reading             */
  66. #define FO_WRITE      0x0001   /* File is opened for writing             */
  67. #define FO_READWRITE  0x0002   /* File is opened for reading and writing */
  68.  
  69. /* File sharing flags */
  70. #define FO_COMPAT     0x0000   /* No sharing specified                               */
  71. #define FO_EXCLUSIVE  0x0010   /* Deny further attempts to open the file             */
  72. #define FO_DENYWRITE  0x0020   /* Deny further attempts to open the file for writing */
  73. #define FO_DENYREAD   0x0030   /* Deny further attempts to open the file for reading */
  74. #define FO_DENYNONE   0x0040   /* Do not deny any further attempts to open the file  */
  75. #define FO_SHARED     FO_DENYNONE
  76.  
  77. /* File inheritance flags */
  78. #define FO_INHERITED  0x0000   /* Spawned processes can inherit this file handle     */
  79. #define FO_PRIVATE    0x0080   /* Spawned processes can not inherit this file handle */
  80.  
  81. /* File seek mode flags */
  82. #define FS_SET        0x0000   /* Seek from beginning of file    */
  83. #define FS_RELATIVE   0x0001   /* Seek from current file poitner */
  84. #define FS_END        0x0002   /* Seek from end of file          */
  85.  
  86. /* File mode flags */
  87. #define FM_BINARY          1   /* Binary mode (raw)  */
  88. #define FM_TEXT            2   /* Test mode (cooked) */
  89.  
  90. /* File system error codes */
  91. #define F_ERROR      ( -1 )   /* Unspecified error */
  92.  
  93. /* Extended file open mode flags */
  94. #define FXO_TRUNCATE  0x0100   /* Create (truncate if exists) */
  95. #define FXO_APPEND    0x0200   /* Create (append if exists)   */
  96. #define FXO_FORCEEXT  0x0800   /* Force default extension     */
  97. #define FXO_DEFAULTS  0x1000   /* Use SET command defaults    */
  98. #define FXO_DEVICERAW 0x2000   /* Open devices in raw mode    */
  99.  
  100. #endif /* _FILEIO_CH */
  101.