package lsp

  1. Overview
  2. Docs
LSP protocol implementation in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

jsonrpc-1.6.1.tbz
sha256=bccc0d7194714a4c40c362766ad9095d3c58505a1d4f1dc4becd9b3d1bda8209
sha512=199bee8c74aec6822bc83bf9a7c3757206bdaa55a19cd1f5cf480127618a078baa1e917f6a90a6135a5277e4eb87977e685c10e6503f546997e6b985949e190f

doc/lsp.stdune/Stdune/Temp/index.html

Module Stdune.TempSource

Temporary file management

This module provides a high-level interface for temporary files. It ensures that all temporary files created by the application are systematically cleaned up on exit.

Sourcetype what =
  1. | Dir
  2. | File
Sourceval temp_in_dir : ?perms:int -> what -> dir:Path.t -> prefix:string -> suffix:string -> Path.t

Create a temporary file or directory inside an existing directory.

Sourceval create : ?perms:int -> what -> prefix:string -> suffix:string -> Path.t
Sourceval destroy : what -> Path.t -> unit
Sourceval clear_dir : Path.t -> unit

Delete the contents of a temporary directory without deleting the directory itself.

Sourceval temp_file : dir:Path.t -> prefix:string -> suffix:string -> Path.t

temp_file ~dir ~prefix ~suffix creates a temporary file in dir. The base name of the file is prefix_num_suffix, where num is a random integer number. Note that the file must be created to reserve the name in dir and prevent other processes from taking it concurrently. If you need a temporary file that does not exist on disk, you can create a temporary directory and safely use any file name there.

Sourceval with_temp_file : dir:Path.t -> prefix:string -> suffix:string -> f:(Path.t Or_exn.t -> 'a) -> 'a

Like temp_file, but passes the temporary file to the callback f, and makes sure the temporary file is deleted when f completes. If f raises an exception, the exception is re-raised (and the file is still deleted).

Sourceval with_temp_dir : parent_dir:Path.t -> prefix:string -> suffix:string -> f:(Path.t Or_exn.t -> 'a) -> 'a

Like with_temp_file, but creates a temporary directory.

Sourcemodule Monad (M : sig ... end) : sig ... end

Versions of with_temp_file and with_temp_dir that are suitable for use with concurrency monads.

OCaml

Innovation. Community. Security.