Comments (4)
@ralish mainly for having windows terminal hot-reload my config when i change it, that is possible only with hard link
from psdotfiles.
Patiently waiting for this.
from psdotfiles.
@soredake I'll try and find some time for this but sadly have little time to invest in personal projects at the moment. Out of curiosity, can you provide more details on your use case for this feature? I've got my own scenarios, but would be interested to hear of others.
from psdotfiles.
I don't believe there's any mechanism available in PowerShell to enumerate all hard links for a file so this would need to be implemented via P/Invoke calls to the Win32 API. We'd need FirstFirstFileNameW, FindNextFileNameW, and FindClose. The GetFinalPathNameByHandleW API may also be needed.
The P/Invoke method signatures are probably something like this (untested):
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, EntryPoint = "GetFinalPathNameByHandleW", ExactSpelling = true, SetLastError = true)]
public extern static int GetFinalPathNameByHandle(Microsoft.Win32.SafeHandles.SafeFileHandle hFile,
System.Text.StringBuilder lpszFilePath,
int cchFilePath,
int dwFlags);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, EntryPoint = "FindFirstFileNameW", ExactSpelling = true, SetLastError = true)]
public extern static Microsoft.Win32.SafeHandles.SafeFileHandle FindFirstFileName(string lpFileName,
int dwFlags,
ref int StringLength,
System.Text.StringBuilder LinkName);
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, EntryPoint = "FindNextFileNameW", ExactSpelling = true, SetLastError = true)]
public extern static bool FindNextFileName(Microsoft.Win32.SafeHandles.SafeFileHandle hFindStream,
ref int StringLength,
System.Text.StringBuilder LinkName);
[DllImport("kernel32.dll", SetLastError = true)]
public extern static bool FindClose(Microsoft.Win32.SafeHandles.SafeFileHandle hFindFile);
from psdotfiles.
Related Issues (12)
- Support PowerShell versions prior to v5 HOT 1
- Automatic detection doesn't work with programs installed via Scoop HOT 1
- Consider expanding automatic detection to include FindInPath
- Add support for disabling folding of directories (`--no-folding` in Stow) HOT 1
- Consolidate user settings into a dictionary
- Not understanding Get-DotFiles HOT 9
- GNU Stow repo compatibility HOT 1
- Unable to handle symlinks earlier in destination path hierarchy HOT 1
- Add support for command execution hooks
- Correctly handle directories with child AdditionalPath or RenamePath elements
- Implement test suite
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psdotfiles.