OS4 DepotLogo by Marko 
(anonymous IP: 54.89.21.96) 
 HomeRecentStatsSearchSubmitUploadsMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
 
 Categories

   o Audio (321)
   o Datatype (47)
   o Demo (176)
   o Development (486)
      o Cross (35)
      o Debug (8)
      o Edit (5)
      o Example (31)
      o Game (19)
      o Guitool (5)
      o Ide (6)
      o Install (0)
      o Language (34)
      o Library (242)
      o Misc (26)
      o Utility (75)
      o Webtool (0)
   o Document (19)
   o Driver (81)
   o Emulation (131)
   o Game (780)
   o Graphics (422)
   o Library (68)
   o Network (185)
   o Office (49)
   o Utility (730)
   o Video (56)

Total files: 3551

Full index file. Download
Recent index file. Download




 Links

  Amigans.net
  OpenAmiga
  Aminet
  UtilityBase
  IntuitionBase
  AmigaBounty


Support the site


 Readme for:  Development » Utility » fileopen.lha

Fileopen

Description: Platform independent ARexx/Rexx I/O routines
Download: fileopen.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 6kb
Version: 1.0
Date: 21 Nov 06
Author: Ned Kelly
Submitter: Ned Kelly
Email: nedkelly/ticnet com
Homepage: http://www.amigamccc.org/files/files0611/FileOpen.lha
Category: development/utility
License: Freeware
Distribute: yes
Min OS Version: 4.0
FileID: 2335
 
Comments: 0  [View]
Snapshots: 0  [View]
Downloads: 138  (Current version)
138  (Accumulated)

Show content Show crashlogs Replace file 
Version: 1.0             13-NOV-2006

This archive contains the following files:
   FileOpen.rexx                          Collection of I/O routines.
   FileOpen_Doc.txt                       This file.
   FileOpen_CopyByChar.rexx               Sample program.
   FileOpen_CopyByLine.rexx               Sample program.
   FileOpen_TestFile.txt                  Sample input file.

This is a collection of Rexx/ARexx routines which perform I/O.  I 
created them to allow me to create Rexx programs which will work on 
both Amiga and Windows platforms without having to modify the code
because of the differences in I/O between Rexx and ARexx.

On the Amiga platform ARexx connects a real filename to a logical name 
when the file is opened and from that point on the logical name is used
exclusively to perform other operations.  Whereas with standard Rexx, 
the real filename is always used for performing all operations.

In all of these functions the first two arguments are:
Argument 1: "LogicalFile"
   This is the logical file name to which the external file will be 
   connected when the file is opened on the Amiga.  This argument is 
   not used on the Windows platform.
Argument 2: "FileName"
   This is the name of the external file.  On the Amiga platform it is
   only used when the file is opened.  On the Windows platfrom it is 
   always used.

The functions are:

FileOpen( LogicalFile, FileName, Mode )
   Argument 3: "Mode"
   This is one of the following:
      "R" for Read
      "W" for Write
      "A" for Append
   This function returns true if the file was successfully opened or
   false if it could not be opened.

FileRead( LogicalFile, FileName )
   This function reads the next line from the file.  The line is 
   returned as the function's result.

FileWrite( LogicalFile, FileName, Line )
   Argument 3: "Line"
   This is a string variable that contains the next line of data to be
   written to the file.  The function always returns a result of zero.

FileChRead( LogicalFile, FileName, Length )
   Argument 3: "Length"
   Length defines the number of characters to be read from the input
   file. 
   The characters read are returned as the function's result.

FileChWrite( LocigalFile, FileName, String )
   Argument 3: "String"
   String contains the character or characters to be written to the
   output file.  This function always returns a result of zero.

FileEOF( LogicalFile, FileName )
   This function returns true if the end of file has been reached or
   flase if the end of file has not been reached.

FileClose( LogicalFile, FileName )
   This closes the file.  On the Amiga, true is returned if the file 
   was closed or flase is if the file could not be closed.  On Windows,
   true is always returned.

FileExists( FileName )
   Whoops!  This function only has one argument.  This function trys 
   to open the specified FileName and returns true if the file exists
   or flase if the file does not exist.

There are two example programs supplied:
   FileOpen_CopyByLine.rexx
      This program copies a file by reading and writing one line at a
      time until and end-of-file is reached.  You can then compare the
      files and/or file sizes to show that things worked right.
   FileOpen_CopyByChar.rexx
      This program copies a file by reading and writing one character 
      at a time until and end-of-file is reached.  You can then compare 
      the files and/or file sizes to show that things worked right.

There is one test file supplied:
   FileOpen_TestFile.txt
      This is a very short text file which can be used as input to 
      either of the above two test programs.  This file is exactly 
      65 bytes long.

Testing: This code has been tested on an AmigaOne with ARexx version 
1.15 and on a Windows XP machine with Regina Rexx version 3.3.


Copyright (c) 2004-2014 by Björn Hagström All Rights Reserved
Amiga OS and its logos are registered trademarks of Hyperion Entertainment