Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.
/ go-windows-fileid Public archive

Query File-ID. File-ID is the number like i-node on Windows.

Notifications You must be signed in to change notification settings

hymkor/go-windows-fileid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-windows-fileid

Query File-ID. File-ID is the number like i-node on Windows.

On Windows, Query(fname) returns File-ID. On UNIX, Query(fname) returns i-node.

package main

import (
	"fmt"
	"os"
	"os/exec"

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

func mains() error {
	id1, err := fileid.Query("main_test.go")
	if err != nil {
		return err
	}
	fmt.Printf("fileid.Query=%x\n", id1)
	cmd := exec.Command("fsutil", "file", "queryFileId", "main_test.go")
	cmd.Stdin = os.Stdin
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr

	return cmd.Run()
}

func main() {
	if err := mains(); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}
$ go run example.go
fileid.Query=da0000000158ac
ファイル ID は 0x000000000000000000da0000000158ac です

About

Query File-ID. File-ID is the number like i-node on Windows.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages