Module wsdk_file

OS independent filesystem layer APIs.

Copyright © 2010-2012 ALEPH ARCHIVES Ltd. All rights reserved.

Version: 1.0.0

Authors: Aleph Archives Ltd. [web site: http://aleph-archives.com/].

Description

OS independent filesystem layer APIs.

This module provides an asbtract low-level functions to deal with filesystem in a portable way (compression, disk-cache optimization, etc.).

Small subpart of its capabilities is exploited for now (stay tuned).

Data Types

handle()

handle() = #wsdk_file{}

Function Index

delete/1Tries to delete the file Filename.
mktemp/0Create a temporary file in the current working directory.
mktemp/1Create a temporary file of "Length" bytes length in the current working directory.
mktemp/2Create a temporary file of "Length" bytes length in the directory "Dir".

Function Details

delete/1

delete(Filename::file:name()) -> ok | {error, term()}

Tries to delete the file Filename. Returns ok if successful.

mktemp/0

mktemp() -> file:name()

Create a temporary file in the current working directory.

This file is guaranteed not to exist at the time of function invocation and is suitable for use by the application (race-condition).

This temporary filname is composed of three parts:

This schema prevents two (or more) Erlang virtual machines to collide by producing the same temporary filename(s) when running in the same box.

Examples: This is equivalent to call: wsdk_file:mktemp(33).

mktemp/1

mktemp(Length::non_neg_integer()) -> file:name()

Create a temporary file of "Length" bytes length in the current working directory.

Note: Length should be >= 11, otherwise the call fails.

This is equivalent to call: wsdk_file:mktemp(Length, '.').

mktemp/2

mktemp(Length::non_neg_integer(), Dir::file:name()) -> file:name()

Create a temporary file of "Length" bytes length in the directory "Dir".

The directory is created if it doesn't exists.

Note: Length should be >= 11, otherwise the call fails.


Generated by EDoc, Sep 5 2012, 17:38:09.