file

File file.str
Author unknown
Since unknown

Portable file operations.




Statistics


General
Lines of code 265
Stratego
Module number 1 (0% documented)
Constructor number 5 (0% documented)
Overlay number 0
Strategy number 29 (72% documented)
Rule number 0
DynamicRule number 0



Constructor summary


Path(ATerm ) n/a file.str
stderr(ATerm ) n/a file.str
stdin(ATerm ) n/a file.str
stdout(ATerm ) n/a file.str
Stream(ATerm ) n/a file.str

Strategy summary


base-filename Strips the directory from a pathname file.str
dirname Returns directory portion of pathname in a POSIX compatible way file.str
fclose Dissociates the named stream from its underlying file or set of functions file.str
fflush n/a file.str
fgetc fgetc() reads the next character from the stream and returns the ASCII code of the character as an Int file.str
fopen Opens the file whose name is the string pointed to by pathname and returns a Stream associated with this file file.str
fputc Writes a Char to a Stream file.str
fputs n/a file.str
get-extension Get extension from filename file.str
guarantee-extension(ATerm ext) Drops the current extension and replaces it with the specified extension file.str
has-extension(ATerm ext) Checks if the file extension is ext file.str
is-abspath Succeeds if the input pathname is an absolute path file.str
is-relpath Succeeds if the input pathname is a relative path file.str
open-stream Opens a Stream associated to a FileLoc file.str
puts Writes a String to stdout with a trailing newline and returns stdout file.str
remove-extension Remove an extension from a file name file.str
stderr-stream n/a file.str
stdin-stream Returns the Stream for stdin, stdout and stderr file.str
stdio-stream n/a file.str
stdio-stream n/a file.str
stdio-stream n/a file.str
stdout-stream n/a file.str
test-extension(Strategy ext) Tests if the file extension (everything after the file.str
tmpnam n/a file.str

Rule summary


add-extension Adds an extension (second argument) to a path (first argument) file.str



Strategy details


ATerm base-filename
File file.str
Author unknown
Since unknown
 

Strips the directory from a pathname.


type String -> String

 
ATerm dirname
File file.str
Author unknown
Since unknown
 

Returns directory portion of pathname in a POSIX compatible way.


type String -> String

 
ATerm fclose
File file.str
Author unknown
Since unknown
 

Dissociates the named stream from its underlying file or set of functions.If the stream was being used for output, any buffered data is written first, using fflush(3).


type Stream -> ()

 
ATerm fgetc
File file.str
Author unknown
Since unknown
 

fgetc() reads the next character from the stream and returns the ASCII code of the character as an Int. Fails on end of file or error.


type Stream -> Char

 
ATerm fopen
File file.str
Author unknown
Since unknown
 

Opens the file whose name is the string pointed to by pathname and returns a Stream associated with this file.For documentation on the mode string, see the man page offopen.

fails if the file couldn't be opened.


type String * String -> Stream

 
ATerm fputc
File file.str
Author unknown
Since unknown
 

Writes a Char to a Stream


type (Char, Stream) -> Stream

 
ATerm get-extension
File file.str
Author unknown
Since unknown
 

Get extension from filename


type String -> String

 
ATerm guarantee-extension(ATerm ext)
File file.str
Author unknown
Since 0.15
 

Drops the current extension and replaces it with the specified extension.


type String -> String

 
ATerm has-extension(ATerm ext)
File file.str
Author unknown
Since 0.15
 
Parameters
ATerm ext The required extension (without . )

Checks if the file extension is ext.


type String -> String

 
ATerm is-abspath
File file.str
Author unknown
Since 0.9.4
 

Succeeds if the input pathname is an absolute path.

A pathname is absolute if it starts with a /.


type String -> String

 
ATerm is-relpath
File file.str
Author unknown
Since 0.9.4
 

Succeeds if the input pathname is a relative path.

A pathname is relative if it does not start with a /.


type String -> String

 
ATerm open-stream
File file.str
Author unknown
Since unknown
 

Opens a Stream associated to a FileLoc


type (FileLoc, String) -> Stream

 
ATerm puts
File file.str
Author unknown
Since unknown
 

Writes a String to stdout with a trailing newline and returns stdout.


type String -> Stream

 
ATerm remove-extension
File file.str
Author unknown
Since unknown
 

Remove an extension from a file name.Returns the input if the file does not have an extension.


type String -> String

 
ATerm stdin-stream
File file.str
Author unknown
Since unknown
 

Returns the Stream for stdin, stdout and stderr


type _ -> Stream

 
ATerm stdio-stream
File file.str
Author unknown
Since unknown
 

No information available.


type FileLoc -> Stream

 
ATerm test-extension(Strategy ext)
File file.str
Author unknown
Since 0.15
 
Parameters
Strategy ext Test for the file extension. Is applied to the plain file extension (without the .)

Tests if the file extension (everything after the . satisfies ext.



 

Rule details


ATerm add-extension
File file.str
Author unknown
Since unknown
 

Adds an extension (second argument) to a path (first argument).


type (String, String) -> String