[1] http://stackoverflow.com/questions/757455/relative-file-paths
[2] File.dirname($PROGRAM_NAME)
[3]:
def getFullPath
modulepath = File.expand_path($PROGRAM_NAME)
modulepath = $modulepath.gsub($PROGRAM_NAME,"")
return modulepath
end
Windows, Linux, Mac OS X, Java and Ruby Tips and Tricks
def getFullPath
modulepath = File.expand_path($PROGRAM_NAME)
modulepath = $modulepath.gsub($PROGRAM_NAME,"")
return modulepath
end
No comments:
Post a Comment