Geeting full path name of a file

Hello all,

how can i get the full path name of a file.like i have file called
“example.csv”. in "D " drive .

when i am using IE with rails i am geeting the full path name .but
when i am using it with firefox i am just getting the filename. is
there any way i could get the full path name

thanks
Jagan

What method are you currently using?

Hi Matt,

I am not using any method for getting the path.As i select the file
name in IE its prinitng the full path of the file as file name in IE
where as in fire fox ,its not printing the fullpath when i am using
the file name that i used in IE.is there any method in ruby which
i can use in for getting the full path of the file

Thanks
Jagan

Jagan did you ever manage to work this out? I need to do the same thing

Thanks!

Don’t want to revive a 5 year old thread. But for those who came here
looking for answers, this is how I got it:

require ‘pathname’
filepath = some_valid_path
Pathname.new(filepath).realpath.to_s

The thing to note is that realpath expects the file to exist.

Is File.expand_path(filename) what you’re looking for?

On Dec 6, 1:13 pm, “Jagan Mohan Jasti” [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs