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"
>> 



On Oct 27, 2010, at 5:54 AM, Arihan Sinha wrote:

> Hi All,
> 
> I wanted to do the following actions.Delete some files from a location
> in windows and mac system .
> 
> System1 ( win 7) ----> System2 (Win 7) which is working fine
> 
> pwd = Dir.pwd
>            Dir.chdir("\\\\System2\\C$\\Users\\TeamCity\\AppData\\Local\\Google\\Chrome\\User
> Data\\Default")
>            FileUtils.rm_r Dir.glob('*'),:force => true
>            Dir.chdir(pwd)
> 
> System1 ( win 7 ) -----> System3 (MAC with Leopard 10.5)
> 
> 
> 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"
> developer / developers-iMac.local "pwd"]
> where the above command executed from System1
> 
> which is working ok and retrieving results as /Users/developer
> 
> developer / developers-iMac.local :- 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
> 
> 
> Cheers
> Arihan
> 
> -- 
> Posted via http://www.ruby-forum.com/.
>