Open file from network share

M

Matt Royer

Hi,

I'm trying to open a file that is on a mapped network drive. I assigned
the letter M for the drive and everything works correctly. I have the
right access and everything.

This is the code I have: f = File.open("M:/38/56/890001000385646.xml")

The rest of my code works when I copy that file to a local folder named
"files", point to it (f = File.open("/files/890001000385646.xml"), and
run the program (I'm using Nokogiri to read the attributes from the
file).

So, I might be missing the syntax of accessing a file across the
network.

Here's the error I receive:

-----
noko-ono.rb:3:in `initialize': No such file or directory -
m:/38/56/890001000385
646.xml (Errno::ENOENT)
from noko-ono.rb:3:in `open'
from noko-ono.rb:3
-----

Anyone know how to write this in the correct syntax?

Thanks in advance,

--Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top