Code Monkey home page Code Monkey logo

filepaths.jl's Introduction

FilePaths.jl

Build Status codecov.io

FilePathsBase.jl provides a type based API for working with filesystem paths. Please review the FilePathsBase docs for more info on working with the base filepath types. FilePaths.jl extends FilePathsBase to provide easier interoperability with the rest of the Julia ecosystem.

Intallation:

FilePaths.jl is registered, so you can to use Pkg.add to install it.

julia> Pkg.add("FilePaths")

Usage:

julia> using FilePaths; using FilePathsBase: /

Globbing files:

julia> using Glob

julia> glob("*test*.jl", p"test")
2-element Array{PosixPath,1}:
 p"test/runtests.jl"
 p"test/test_uri.jl"

URIParsing:

julia> using URIs

julia> URI(cwd() / p"test/runtests.jl")
URI("file:///Users/rory/repos/FilePaths.jl/test/runtests.jl")

Writing String and AbstractPath compatible code:

julia> FilePaths.@compat function myrelative(x::AbstractPath, y::AbstractPath)
           return relative(x, y)
       end
myrelative (generic function with 2 methods)

julia> FilePaths.@compat function myjoin(x::P, y::String)::P where P <: AbstractPath
           return x / y
       end
myjoin (generic function with 2 methods)

julia> myrelative(cwd(), home())
p"repos/FilePaths.jl"

julia> myrelative(pwd(), homedir())
p"repos/FilePaths.jl"

julia> myjoin(parent(cwd()), "FilePaths.jl")
p"/Users/rory/repos/FilePaths.jl"

julia> myjoin("/Users/rory/repos", "FilePaths.jl")
"/Users/rory/repos/FilePaths.jl"

filepaths.jl's People

Contributors

davidanthoff avatar jmkuhn avatar juliatagbot avatar meggart avatar omus avatar oxinabox avatar rofinn avatar vtjnash 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.