Code Monkey home page Code Monkey logo

flo's Introduction

FLO (File Layer Operations)

... is a Go library to simplify working with files and directories. Feel free to use or fork it, if it works for you.

It is intended to be fast to use with a certain degree of flexibility.

Examples

ls -lha

You can find an implementation of ls -lha with some additional features here.

examples/codecs/main.go

A test application for reading and writing data using the different formats supported. Also tests checksum comparisons.

examples/exec/main.go

A simple application that can execute another application.

examples/flat-tree/main.go

A tool that can list all files and directories contained in a directory. Recursion depth can be limited.

examples/hello/main.go

An example that shows how to create a script on the fly, make it executable and execute it.

examples/ls/main.go

An example that acts like a call to ls.

examples/tree/main.go

Similar to the flat-tree example, but displays a tree structure instead, just like good ol' tree.

Logging

There are a few cases where the library logs, in those cases it will use the Error and Panic functions found in log/main.go. You can overwrite these functions to handle errors yourself, e.g. to ignore errors:

// silence all logging
log.SetFns(nil, nil) 

// no errors, custom panic handler
log.SetFns(nil, func(fmtStr string, args ...any) { panic(fmt.Sprintf("lib died: "+fmtStr, args...)) })

// no panics, custom error handler
log.SetFns(func(err error, fmtStr string, args ...any) (shouldReturn bool) { fmt.Println("Error", err.Error()) ; return err != nil }, nil)

flo's People

Contributors

toxyl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.