Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Moving photos from a media card
12 34
6/20/2007 5:32:00 AM
Trying to move and rename photos from a media card using OS X.
I get this error:
Errno::EXDEV: Cross-device link -
/Volumes/CANON_DC/DCIM/100CANON/IMG_2324.JPG or /Volumes/Knobby Aperture
Disk/Photos-digital/ Photographs/_Download folder/Latest
Download/2007.01.11-2324.gs-c.jpg
basic command is:
File.rename(File.join(dirPhotoCard, fileName), File.join(downloadFolder,
newFileName))
Works fine if I chang the dirPhotoCard to a folder on my Mac
I basically following Pine's Renamimg your photos script. I went back
and tried his script and I got the same results. Worked with Mac to Mac,
but not media card to Mac.
I tried a different type of card (Compact Flash instead of SD and got
the same results).
Thanks for any suggestions
--
Posted via
http://www.ruby-...
.
2 Answers
Axel Etzold
6/20/2007 9:44:00 AM
0
This issue has already been discussed on this list:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...
If you still can't copy files, you may not have sufficient
reading/writing privileges for the device or it might not be
mounted ..
Best regards,
Axel
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung:
http://www.gmx.net/de/g...
12 34
6/20/2007 5:16:00 PM
0
Axel Etzold wrote:
> This issue has already been discussed on this list:
>
>
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-t...
>
Axel
Thanks, that got me to a solution. I found a related discussion at
http://www.ruby-...
topic/78...
I went with since it breaks the operation down into more understand
steps, and it works:
require 'fileutils'
include FileUtils
cp(old, new ) # copy(old,new) works too if you like me don't talk UNIX
rm (old) # remove(old)
There seems to be some confusion about how Ruby handles moving (mv)
files. Moving files is supposed to work with rename, but apparently
breaks down when the new and old directories are not in the same
partition. But the cp and rm steps are clearer than renaming and moving
(copying and deleting) in one step which is what I'm trying to do. (In
other words, it's not obvious from the name that "rename" renames and
moves.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Moving photos from a media card
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password