fs

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(_ context.Context, args ...core.Value) (core.Value, error)

Read reads from a given file. @params path (String) - path to file to read from. @returns data (Binary) - the read file in binary format.

func RegisterLib

func RegisterLib(ns core.Namespace) error

RegisterLib register `FS` namespace functions.

func Write

func Write(_ context.Context, args ...core.Value) (core.Value, error)

Write writes the given data into the file. @params path (String) - path to file to write into. @params data (Binary) - data to write. @params params (Object) optional - additional parameters:

  • mode (String):
  • x - Exclusive: returns an error if the file exist. It can be combined with other modes
  • a - Append: will create a file if the specified file does not exist
  • w - Write (Default): will create a file if the specified file does not exist

@returns None

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL