Module Fileutil


module Fileutil: sig  end
File-related utilities.

This module provides various helpful utilities for deailing with files.
Author(s): Copyright (C) 2004 John Goerzen




File name utilities
These functions work on file names.

val abspath : ?startdir:string -> string -> string
abspath filename
returns the absolute path of filename. If startdir is given, it is used instead of the current working directory to work out relative paths.

This function works algorithmically, rather than via changing directories, and as such does not resolve symlinks or die if bad paths are given.



File reading
These functions help read data file files.

val getfirstline : string -> string
Opens file given, reads the first line, closes the file, and returns that line.
val getlines : string -> string list
Opens file given, reads all lines, closes the file, and returns a list of those lines.