Open file from network share

Discussion in 'Ruby' started by Matt Royer, Nov 12, 2010.

  1. Matt Royer

    Matt Royer Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
    Matt Royer, Nov 12, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay
    Replies:
    2
    Views:
    921
    Peter O'Reilly
    Nov 21, 2003
  2. john smith
    Replies:
    0
    Views:
    441
    john smith
    Jan 6, 2004
  3. =?Utf-8?B?QmFyZW4=?=

    File Download from Network Share

    =?Utf-8?B?QmFyZW4=?=, Jun 1, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    630
    =?Utf-8?B?QmFyZW4=?=
    Jun 3, 2005
  4. =?Utf-8?B?QW5kcmU=?=

    How to create file on network share from ASP.NET

    =?Utf-8?B?QW5kcmU=?=, Jul 20, 2005, in forum: ASP .Net
    Replies:
    12
    Views:
    8,229
    homertbush
    Mar 5, 2008
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,322
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page