C Library Functions - filewrite (3)
NAME
filewrite(3f) - [M_io:WRITE] A simple write of a CHARACTER array to a file
(LICENSE:PD)
CONTENTS
Synopsis
Description
Option
Returns
Examples
Author
License
SYNOPSIS
function filewrite(filename,data,status,position) result(ierr)
character(len=*),intent(in) :: filename
character(len=*),intent(in) :: data(:)
character(len=*),intent(in),optional :: status
character(len=*),intent(in),optional :: position
integer :: ierr
DESCRIPTION
A convenience procedure for writing a CHARACTER array as
a new file.
OPTION
FILENAME |
|
file to create or write. If the name ends
in ">" the default for STATUS changes to
"REPLACE". If it ends in ">>" STATUS changes to
"UNKNOWN" and the default POSITION changes to "APPEND".
|
DATA |
CHARACTER array to write to file
|
STATUS |
STATUS to use on OPEN(7f). Defaults to "NEW".
|
Allowed values are | |
NEW|REPLACE|OLD|SCRATCH|UNKNOWN
|
|
|
POSITION |
|
POSITION to use on OPEN(7f). Defaults to "REWIND".
|
Allowed values are | |
ASIS|REWIND|APPEND
|
|
|
|
RETURNS
IERR |
status value. Zero indicates no error occurred
|
|
EXAMPLES
Sample program:
program demo_filewrite
use M_io, only : filewrite
implicit none
integer :: ierr
character(len=:),allocatable :: data(:)
data=[ character(len=80) :: &
&This is the text to write , &
&into the file. It will be , &
&trimmed on the right side. , &
& , &
& That is all Folks! , &
&]
ierr=filewrite(_scratch.txt,data)
end program demo_filewrite
AUTHOR
John S. Urban
LICENSE
Public Domain
Nemo Release 3.1 | filewrite (3) | February 23, 2025 |
Generated by manServer 1.08 from 47aa7fa7-f4ca-4732-908f-c274760dcc4f using man macros.