win32linktypes

package module
v0.0.0-...-d2c8fc6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 2 Imported by: 0

README

win32linktypes

A small Go module for Windows that determines the type of a filesystem link (Symlink, Directory Symlink, Junction, etc.) by analyzing its reparse point attributes.

Installation

go get github.com/LogicDaemon/win32linktypes

Usage

package main

import (
	"fmt"
	"log"

	"github.com/LogicDaemon/win32linktypes"
)

func main() {
	linkType, err := win32linktypes.GetType("C:\\path\\to\\link")
	if err != nil {
		log.Fatalf("Error: %v", err)
	}

	fmt.Printf("Link type: %s\n", linkType)
	// Output could be: "File Symlink", "Directory Symlink", "Junction", "Normal", etc.
}

Testing

Ensure you are running on a Windows system with Developer Mode enabled or as Administrator (required for MKLINK usage). Then simply run:

go test -v

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileAttributeTagInfo

type FileAttributeTagInfo struct {
	FileAttributes uint32
	ReparseTag     uint32
}

FileAttributeTagInfo mirrors FILE_ATTRIBUTE_TAG_INFO

type Type

type Type int
const (
	TypeUnknown Type = iota
	TypeNormal
	TypeFileSymlink
	TypeDirectorySymlink
	TypeJunction
	TypeOtherReparsePoint
)

func GetType

func GetType(path string) (Type, error)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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