junction

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 1 Imported by: 1

README

go-windows-junction

Create junctions on Windows.

package main

import (
    "os"
    "errors"

    "github.com/zetamatta/go-windows-junction"
)

func main1() error {
    if len(os.Args) < 3 {
        return errors.New("go run example.go TARGET MOUNTPT")
    }
    if err := junction.Create(os.Args[1], os.Args[2]); err != nil {
        return err
    }
    result, err := os.Readlink(os.Args[2])
    if err != nil {
        return err
    }
    println(os.Args[2], " is linked to ", result)
    return nil
}

func main() {
    if err := main1(); err != nil {
        println(err.Error())
        os.Exit(1)
    }
}
$ go run example.go ../nyagos nya
nya  is linked to  C:\Users\hymko\go\src\github.com\zetamatta\nyagos

Documentation

Index

Constants

View Source
const FSCTL_SET_REPARSE_POINT = 589988

Code generated by go-importconst DO NOT EDIT.

Variables

This section is empty.

Functions

func Create

func Create(target, mountPt string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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