I am trying to access the folder of the mac system by using window
explorer in my system1 and navigate to the
\System3\Users\teamcity\Library but its not successful.
Note:- the “teamcity” is the user name in the system1 and exactly same
name in the mac system as well as userid.
Workaround:- though I am using now PuTTY like
puts %x[c:\Program Files (x86)\PuTTY\plink -i “C:\Program Files
(x86)\TamCity\.ssh\authorized_key.ppk” [email protected] “pwd”]
where the above command executed from System1
which is working ok and retrieving results as /Users/developer
[email protected] :- where developer is the current logged
in user to the mac system (i.e developers-iMac.local)
can anyone please guide me so that I can access the folders in Mac like
\System3\Users\teamcity\Library.
Then It would be easy for me to use Dir.chdir and move on
System1: WinXP logged in with username :- teamcity
System2:- MAC system (ip=172.20.10.65) with lepard 10.5 and logged in
with username:- developer
Can you please try the similar way and let me know the output
C:\Documents and Settings\TeamCity>irb
irb(main):001:0> Dir.pwd
=> “C:/Documents and Settings/TeamCity”
irb(main):002:0> Dir.chdir(“172.20.10.65/Users/developer/Library”)
Errno::ENOENT: No such file or directory -
172.20.10.65/Users/developer/Library
from (irb):2:in `chdir’
from (irb):2
irb(main):003:0> Dir.pwd
=> “C:/Documents and Settings/TeamCity”
irb(main):004:0> Dir.chdir("/172.20.10.65/Users/developer/Library")
Errno::ENOENT: No such file or directory -
/172.20.10.65/Users/developer/Library
from (irb):4:in `chdir'
from (irb):4
irb(main):005:0> Dir.pwd
=> “C:/Documents and Settings/TeamCity”
irb(main):006:0>
I am trying to access the folder of the mac system by using window
explorer in my system1 and navigate to the
\System3\Users\teamcity\Library but its not successful.
What error do you receive when attempting to access that location using
the Windows file explorer? Have you enabled any sort of
Windows-compatible file sharing on your Mac? Is authentication required
in order to access any shares your Mac may be providing?
I can’t do much more than provide general hand waving when it comes to
Macs since I’ve never used OSX myself, unfortunately. Hopefully, these
questions can get you started moving in the right direction.
Mac is Unix, so the file path is going to be different - it’s a forward slash,
rather than backslash:
Dir.chdir("\Users\rilindo\src\test")
Errno::ENOENT: No such file or directory - \Users\rilindo\src\test
from (irb):3:in `chdir’
from (irb):3
Dir.chdir("/Users/rilindo/src/test")
=> 0
Dir.pwd
=> “/Users/rilindo/src/test”
This will only apply if the Ruby script is actually run on the Mac
itself rather than on the Windows system. The OP is trying to run the
script on Windows while accessing the directory to be processed on the
Mac via Windows file sharing. The backslashes are appropriate in this
case; however, Windows /will/ use backslashes and forward slashes mostly
interchangeably.
Errno::ENOENT: No such file or directory -
from (irb):4
irb(main):005:0> Dir.pwd
=> “C:/Documents and Settings/TeamCity”
irb(main):006:0>
Remember that you’re using Windows to access a remote share using
Windows file sharing. That means you need to use a UNC path to access
the share, and a UNC path begins with either \ or //. What you
attempted above wouldn’t even work if the system at 172.20.10.65 was a
Windows system instead of a Mac.
Errno::ENOENT: No such file or directory -
from (irb):4
irb(main):005:0> Dir.pwd
=> “C:/Documents and Settings/TeamCity”
irb(main):006:0>
Remember that you’re using Windows to access a remote share using
Windows file sharing. That means you need to use a UNC path to access
the share, and a UNC path begins with either \ or //. What you
attempted above wouldn’t even work if the system at 172.20.10.65 was a
Windows system instead of a Mac.
-Jeremy
#########################
For windows system I am using this which is working ok … System1(
windows) to system2 ( windows) where ruby is running in system1 only…(
ruby need not to be installed in system2 because i am only accssing the
files from system2)
the share, and a UNC path begins with either \ or //. What you
ruby need not to be installed in system2 because i am only accssing the
Now the similar way I am looking for Mac where the system2 is Mac (
172.20.10.65)
so how would i change the dir from system1 to Mac system.
I want to go to the 172.20.10.65(this is mac system
IP)/Users/teamcity/Library
If you find the exact solution then pls let me know.
As I mentioned in one of my other responses in this thread, I don’t have
a Mac and can only provide general guidance. First, make sure that
whatever passes for Windows file sharing is enabled on the Mac. Next,
check that you can use the Windows file explorer on system1 to access
whatever path you want to access on the Mac. If it doesn’t work at this
point, go back and keep debugging until it does.
Once you can use standard tools to access the data on the Mac, you can
drop into Ruby to do your work without any extra effort, similar to
accessing system2.
the share, and a UNC path begins with either \ or //. What you
ruby need not to be installed in system2 because i am only accssing the
Now the similar way I am looking for Mac where the system2 is Mac (
172.20.10.65)
so how would i change the dir from system1 to Mac system.
I want to go to the 172.20.10.65(this is mac system
IP)/Users/teamcity/Library
If you find the exact solution then pls let me know.
the share, and a UNC path begins with either \ or //. What you
ruby need not to be installed in system2 because i am only accssing the
Now the similar way I am looking for Mac where the system2 is Mac (
172.20.10.65)
so how would i change the dir from system1 to Mac system.
I want to go to the 172.20.10.65(this is mac system
IP)/Users/teamcity/Library
If you find the exact solution then pls let me know.
Thanks everyone. I’ve done with lot of struggle since from yesterday.
Its very straight forward though same way for other windows systems .No
forward or back slash confusion:)