Set file permissions/Execute program on another mac

609 views
Skip to first unread message

oyvind...@gmail.com

unread,
May 14, 2013, 5:12:24 AM5/14/13
to golan...@googlegroups.com
Hi everyone!

I'm having a problem with an application I'm making. It is a simple chat program written in go (obviously) and it runs in the terminal. Now, I want my laptop to be the server and let the client program run on two different macs (for example). So I built the client program on my laptop and tried to run it on the other one, but in the terminal I get "Permission denied". 

1. Can I make changes on the source code to give the program proper permissions to run, or do I have to do it manually/set user permissions on every computer trying to run my program? Regarding the first alternative, I am aware of the "os"-package with FileMode, I just dont know how to use it correctly... :/

2. Both macs have intel cpu, but one is core 2 duo and the other sandy bridge. Is this a problem?

I hope I didn't post in wrong thread, and if so hope some of you can point my in the right direction.

Thanks!

Tamás Gulácsi

unread,
May 14, 2013, 8:55:49 AM5/14/13
to golan...@googlegroups.com
How did you distribute the binary?
Executable permission bit has been unset.

oyvind...@gmail.com

unread,
May 14, 2013, 9:03:05 AM5/14/13
to golan...@googlegroups.com
Sorry, I don't quite understand your question. What I did was to run "go build -o 'name' file.go" and then I tried to run this executable on the other mac. How can I reset this bit? :)

Kevin Malachowski

unread,
May 14, 2013, 10:46:00 AM5/14/13
to golan...@googlegroups.com
Usually it's just a call to the program "chmod" (I think macs have this program?)

Just run "chmod +x [executable]" and it will run if this is the problem.

oyvind...@gmail.com

unread,
May 16, 2013, 3:13:27 AM5/16/13
to golan...@googlegroups.com
It certainly fixed the "permission denied" problem, thank you! 
But the program still wont run on the other mac. Is this due to the different CPUs?

Dave Cheney

unread,
May 16, 2013, 3:21:05 AM5/16/13
to oyvind...@gmail.com, golan...@googlegroups.com
Can you provide some output when your program does not run on the other mac. When you say different CPU, can you explain what you mean ?
--
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.
 
 

oyvind...@gmail.com

unread,
May 16, 2013, 4:11:39 AM5/16/13
to golan...@googlegroups.com, oyvind...@gmail.com
Certainly, but I cant until I get home later this evening (currently at school studying for an exam, and I've only got my computer here;)). 
I have Intel Core 2 Duo while the other one Intel Sandy Bridge. They're both Intel, but I guess they've got different architectures (if I'm using that word right) and think that can cause a problem, but I'm not sure.

Thank you all for answering :)

I will post some output when I get home!
Message has been deleted

Andy Balholm

unread,
May 16, 2013, 11:39:28 AM5/16/13
to golan...@googlegroups.com, oyvind...@gmail.com
It's more likely to be different operating system versions than different CPUs. If you're linking against LibSystem on a Mountain Lion machine and trying to run on a Snow Leopard machine, I can imagine that the dynamic linker might not like the fact that LibSystem is older than the one you linked with.
Reply all
Reply to author
Forward
0 new messages