On Sun, Dec 19, 2021 at 9:03 AM Jochen Wiedmann
<[email protected]> wrote:
>
> Having worked with symbolic links on Windows a lot, I find that
> privileges are present, in most cases. However, there is the technical
> question "How do I create them?"

java.nio.file.Files.createSymbolicLink(Path, Path, FileAttribute<?>...)

The API is documented as an optional operation so we might need a set
of OS-specific calls to Runtime.exec(String).

Gary

>
> The best solution, that I have found so far is letting "cmd" do the
> job for me. (The mklink command is not a separate executable, but
> build into cmd.)
>
> https://github.com/jochenw/afw/blob/master/afw-core/src/main/java/com/github/jochenw/afw/core/components/WindowsCmdSymbolicLinksHandler.java
>
> Jochen
>
>
> On Sat, Dec 18, 2021 at 7:43 PM Tim Perry <[email protected]> wrote:
> >
> > I like this idea, but I think it would require non-default permissions for 
> > the account the application runs under on windows. However, it could be 
> > feature that can be switched on.
> >
> > https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links
> >
> > Maybe I read the docs from MS incorrectly.
> >
> > Tim
> >
> >
> > > On Dec 18, 2021, at 7:07 AM, Gary Gregory <[email protected]> wrote:
> > >
> > > Hi All:
> > >
> > > And now for something completely different.
> > >
> > > I wonder why we do not do file rollovers like below, and if we should:
> > > - Create the file with the target rolled over a name like applog-2021.txt
> > > - Create a symlink for the constant name like applog.txt to point to
> > > applog-2021.txt
> > > - When it's rollover time, start writing to the new file
> > > applog-2022.txt and change the symlink to point to it.
> > >
> > > Zero copy.
> > >
> > > Thoughts?
> > >
> > > Gary
>
>
>
> --
> Philosophy is useless, theology is worse. (Industrial Desease, Dire Straits)

Reply via email to