2009-08-08 74 views

回答

1

我想我找到了解決方案Dir.pwd

愚蠢的我忘了,PWD不是密碼,但是打印工作目錄的首字母縮寫...

尷尬:)

4

Class:Dir

Dir.getwd => string 
Dir.pwd => string 

Returns the path to the current working directory of this process as a string. 

Dir.chdir("/tmp") #=> 0 
Dir.getwd   #=> "/tmp" 
1

您還可以,如果你覺得用它做事情的方式CLR:

include System 
Environment.current_directory => clr_string