Symlink in Windows

530 views
Skip to first unread message

Archos

unread,
Jun 21, 2013, 6:09:46 AM6/21/13
to golan...@googlegroups.com
It is supposed that all function is package os are platform-independentand and work in every system. But os.Symlink is not supported in Windows:

* * *
package main

import (
    "io/ioutil"
    "log"
    "os"
)

const old = "old.txt"

func main() {
    err := ioutil.WriteFile(old, []byte("The ecstasy of Gold\n"), 0644)
    if err != nil {
        log.Fatal(err)
    }

    err = os.Symlink(old, "new.txt")
    if err != nil {
        log.Fatal(err)
    }
}
* * *
symlink old.txt new.txt: not supported by windows

brainman

unread,
Jun 21, 2013, 7:07:41 AM6/21/13
to golan...@googlegroups.com
Yes, it is not implemented. No one has asked for it yet. I hope no one will.

Alex

peterGo

unread,
Jun 21, 2013, 8:18:03 AM6/21/13
to golan...@googlegroups.com
Archos,

Yes, symbolic links should be implemented for Windows: Vista, Server 2008, and later.

Symbolic Links
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365680.aspx

Requirements

Minimum supported client
    Windows Vista [desktop apps only]

Minimum supported server
    Windows Server 2008 [desktop apps only]

To contribute changes to the Go project, read:

Contribution Guidelines
http://golang.org/doc/contribute.html

Open an issue.

Peter

Daniel Theophanes

unread,
Jun 21, 2013, 10:51:30 AM6/21/13
to golan...@googlegroups.com
You are correct. They can even be used on Windows XP. Just the users don't know how to use it and there is a near complete lack of "official" tools for it. The command interpreter, which hasn't changed from Windows 2000 pre-dates even simple junctions. 

Archos

unread,
Jun 21, 2013, 1:10:41 PM6/21/13
to golan...@googlegroups.com

paulo....@gmail.com

unread,
Jun 21, 2013, 2:27:01 PM6/21/13
to golan...@googlegroups.com
Easy, on XP use Windows Resource tools from technet for junctions.

Since Vista, mklink.

Mikhael Ardi

unread,
Jun 21, 2013, 2:53:21 PM6/21/13
to brainman, golan...@googlegroups.com
On Fri, Jun 21, 2013 at 4:07 AM, brainman <alex.b...@gmail.com> wrote:
No one has asked for it yet. I hope no one will.

Alex

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Why do you hope no one will?

Nate Finch

unread,
Jun 21, 2013, 3:07:20 PM6/21/13
to golan...@googlegroups.com
Isn't that what this thread is? :)

Mikhael Ardi

unread,
Jun 21, 2013, 3:40:15 PM6/21/13
to Nate Finch, golan...@googlegroups.com
He just comes across as another Windows basher. "ooh I use teh Linux, I am 1337, u n00b windows user"


--

Nate Finch

unread,
Jun 21, 2013, 3:52:55 PM6/21/13
to golan...@googlegroups.com, Nate Finch
I don't think that was his intent. Yes, it appears there are fewer developers on the core Go team that are deeply familiar with Windows development, and thus does tend to get the short end of the stick. I think that's more a problem of lack of highly skilled Windows developers in general, rather than an indictment of the OS. Also, most of the pressure to implement features comes from production use of the code, and that's usually *nix based.

John C.

unread,
Jun 21, 2013, 10:22:20 PM6/21/13
to golan...@googlegroups.com
Be pleasantly reassured that brainman has been one of the primary early, long, and strong supporters of Go on Windows. If there's anything derogatory to say about any potential frustrations of getting Go working on Windows, he's earned the right to say it. :-)

John C.

Dave Cheney

unread,
Jun 21, 2013, 10:29:02 PM6/21/13
to John C., golang-nuts
Seconded! I think perhaps an apology is in order.

On Sat, Jun 22, 2013 at 12:22 PM, John C. <jscroc...@gmail.com> wrote:
> Be pleasantly reassured that brainman has been one of the primary early, long, and strong supporters of Go on Windows. If there's anything derogatory to say about any potential frustrations of getting Go working on Windows, he's earned the right to say it. :-)
>
> John C.
>

John Crockett

unread,
Jun 21, 2013, 10:41:40 PM6/21/13
to golang-nuts
Presumably the writer was genuinely unaware of Alex's contributions, out of which context Alex's terse reply is easily misunderstood. 

Mikhael Ardi

unread,
Jun 22, 2013, 4:21:53 AM6/22/13
to Dave Cheney, John C., golang-nuts
Indeed. Sorry about the misunderstanding :)

Hraban Luyat

unread,
Jun 22, 2013, 5:34:15 AM6/22/13
to golan...@googlegroups.com, Dave Cheney, John C.
that was a beautiful little thread. for what it's worth; I laughed at your message.

Guilherme Lino

unread,
Jun 22, 2013, 8:46:00 PM6/22/13
to golan...@googlegroups.com

Archos

unread,
Jun 23, 2013, 5:56:44 AM6/23/13
to golan...@googlegroups.com
I had downloaded a wonderful live of that song, from Saint Mark's Square in Venice on September 10, 2007.
But it was removed: https://www.youtube.com/watch?v=t2ywcbezRp4

brainman

unread,
Jun 23, 2013, 6:46:44 AM6/23/13
to golan...@googlegroups.com, brainman
On Saturday, 22 June 2013 04:53:21 UTC+10, Mikhael Ardi wrote:
Why do you hope no one will?

I have never seen one in my life. And I am not a young man. How important can these be then? :-)
My apology for creating hiatus with my silly remarks. I hope no harm done.

Alex

brainman

unread,
Jun 23, 2013, 6:48:00 AM6/23/13
to golan...@googlegroups.com
On Saturday, 22 June 2013 05:07:20 UTC+10, Nate Finch wrote:
Isn't that what this thread is? :)


Shhhh!!!! Maybe none will notice. :0)

Alex 

Nate Finch

unread,
Jun 23, 2013, 8:24:56 AM6/23/13
to golan...@googlegroups.com, brainman
I used to use them all the time at work.... we tend to have a lot of different branches of code, and many of them share the same dependencies, but expect them in a path relative to the current branch. Symlinking lets me only download the dependencies in a single spot and then symlink that into the relative paths that each branch expects.  I was eventually going to automate that so that everyone in the company could get the same benefit, but never got around to it before we moved to a different project.

If I was less busy I'd just write the symlink package myself. It would be fun, I think, and probably not more than a weekend's work.

Hraban Luyat

unread,
Jun 23, 2013, 8:39:08 AM6/23/13
to golan...@googlegroups.com
if that happens it will be the ultimate smackdown in a programming
language war. as far as anything in a programming language war can be
considered "ultimate".

"Oh yeah? Well Go is so elite, it supports actual symlinks on Windows.
What now?! Yeah that's right, you better roll on."
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/fSjM8aga_6Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

paulo....@gmail.com

unread,
Jun 23, 2013, 12:23:26 PM6/23/13
to golan...@googlegroups.com
There are already quite a few languages that offer symlink support on Windows.

You are not going to win the elite argument.
Reply all
Reply to author
Forward
0 new messages