std-fopen


Synopsis

(std-fopen <fname> <mode-char>)

Description

std-fopen opens the file specified with fname fro reading, writing or appending, as with open. On success it adds the returned file to a global list *FOPEN* to be able to close it on any error while processing the file, therefore it should be used instead of open.

This is workaround for the common lisp macro with-open-file.

For possible problems see the section on open.

mode-char must be either "r", "w" or "a"

Note: You may not use the file atom returned by std-fopen for any binio-xxx function!

Example

(std-fopen "TEST.INI" "w")  => <FILE:0xxx>

Arguments

fname: a string. A partial or fully qualified filename specifier.

Return Value

An atom of type FILE on sucess or nil.

Side Effects

It opens a file for reading, writing or appending.

On success it adds the FILE atom to the global list *FOPEN*

Otherwise it throws an error. Operating system exceptions might occur.

Module

(std-require 'STDFILE)

Defined in STDFILE