Cross-device link error

Discussion in 'Ruby' started by Greg, Apr 20, 2007.

  1. Greg

    Greg Guest

    Working through Pine's Programming book and got this error (complete at
    bottom):

    Cross-device link -...(Errno::EXDEV)

    Trying to read photos from a memory card to hard drive and rename them.
    Someone posted the same error on the book's errata page and I didn't
    see a response so though I better look elsewhere

    gscar-computer:~ gscar$ ruby "/Users/gscar/Documents/Ruby/Pine-Learning
    to Script/RenamingYourPhotos\302\24711.5.y.rb"
    What would you like to call this batch?
    Testing

    Downloading 3 files:
    /Users/gscar/Documents/Ruby/Pine-Learning to
    Script/RenamingYourPhotos§11.5.y.rb:38:in `rename': Cross-device link -
    /Volumes/CANON_DC/DCIM/100CANON/IMG_2324.JPG or Testing01.jpg
    (Errno::EXDEV)
    from /Users/gscar/Documents/Ruby/Pine-Learning to
    Script/RenamingYourPhotos§11.5.y.rb:38
    from /Users/gscar/Documents/Ruby/Pine-Learning to
    Script/RenamingYourPhotos§11.5.y.rb:28:in `each'
    from /Users/gscar/Documents/Ruby/Pine-Learning to
    Script/RenamingYourPhotos§11.5.y.rb:28
    =======
    Line 28 is: picNames.each do |name| 
Line 38 is: File.rename name, newName

    Thanks for any help

    Newbie
     
    Greg, Apr 20, 2007
    #1
    1. Advertisements

  2. Greg

    Dan Zwell Guest

    Greg wrote:
    > Working through Pine's Programming book and got this error (complete at
    > bottom):
    >
    > Cross-device link -...(Errno::EXDEV)
    >
    > Trying to read photos from a memory card to hard drive and rename them.
    > Someone posted the same error on the book's errata page and I didn't see
    > a response so though I better look elsewhere
    >
    > gscar-computer:~ gscar$ ruby "/Users/gscar/Documents/Ruby/Pine-Learning
    > to Script/RenamingYourPhotos\302\24711.5.y.rb"
    > What would you like to call this batch?
    > Testing
    >
    > Downloading 3 files:
    > /Users/gscar/Documents/Ruby/Pine-Learning to
    > Script/RenamingYourPhotos§11.5.y.rb:38:in `rename': Cross-device link -
    > /Volumes/CANON_DC/DCIM/100CANON/IMG_2324.JPG or Testing01.jpg
    > (Errno::EXDEV)
    > from /Users/gscar/Documents/Ruby/Pine-Learning to
    > Script/RenamingYourPhotos§11.5.y.rb:38
    > from /Users/gscar/Documents/Ruby/Pine-Learning to
    > Script/RenamingYourPhotos§11.5.y.rb:28:in `each'
    > from /Users/gscar/Documents/Ruby/Pine-Learning to
    > Script/RenamingYourPhotos§11.5.y.rb:28
    > =======
    > Line 28 is: picNames.each do |name| 
Line 38 is: File.rename name, newName
    >
    > Thanks for any help
    >
    > Newbie
    >
    >
    >


    You've gotta give us some more information. It would be better to
    include the whole method than just one line.

    Dan
     
    Dan Zwell, Apr 20, 2007
    #2
    1. Advertisements

  3. Hi,

    At Fri, 20 Apr 2007 09:45:06 +0900,
    Greg wrote in [ruby-talk:248510]:
    > Working through Pine's Programming book and got this error (complete at
    > bottom):
    >
    > Cross-device link -...(Errno::EXDEV)
    >
    > Trying to read photos from a memory card to hard drive and rename them.


    File.rename doesn't copy file content, just change the name.
    So it can't move a file across devices. You may want to use
    FileUtils.cp method.

    --
    Nobu Nakada
     
    Nobuyoshi Nakada, Apr 20, 2007
    #3
    1. Advertisements

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. Replies:
    1
    Views:
    3,676
    CyberOwl
    Sep 7, 2009
  2. Raphael Bauduin

    JMF error: No such capture device!

    Raphael Bauduin, Mar 6, 2004, in forum: Java
    Replies:
    2
    Views:
    8,348
    Knute Johnson
    Mar 7, 2004
  3. nishadixit
    Replies:
    5
    Views:
    1,538
    Joe Discar
    Jun 1, 2005
  4. Scott  Whitney
    Replies:
    3
    Views:
    10,605
    JustScott
    Feb 16, 2005
  5. Replies:
    1
    Views:
    635
    santosh
    Nov 27, 2006
  6. debayan_p

    IO-Link Slave Device IP Core

    debayan_p, Jun 23, 2009, in forum: VHDL
    Replies:
    1
    Views:
    899
    debayan_p
    Jun 23, 2009
  7. Matt
    Replies:
    0
    Views:
    649
  8. arnie
    Replies:
    0
    Views:
    918
    arnie
    Aug 24, 2007
Loading...