package tiny_httpd

  1. Overview
  2. Docs

Module type Tiny_httpd_dir.VFSSource

Virtual file system.

This is used to emulate a file system from pure OCaml functions and data, e.g. for resources bundled inside the web server.

  • since 0.12
Sourceval descr : string

Description of the VFS

Sourceval is_directory : string -> bool
Sourceval contains : string -> bool

file_exists vfs path returns true if path points to a file or directory inside vfs.

Sourceval list_dir : string -> string array

List directory. This only returns basenames, the files need to be put in the directory path using Filename.concat.

Sourceval delete : string -> unit

Delete path

Sourceval create : string -> (bytes -> int -> int -> unit) * (unit -> unit)

Create a file and obtain a pair write, close

Sourceval read_file_content : string -> Tiny_httpd_stream.t

Read content of a file

Sourceval file_size : string -> int option

File size, e.g. using "stat"

Sourceval file_mtime : string -> float option

File modification time, e.g. using "stat"

OCaml

Innovation. Community. Security.