env: OSX 10.10 / iPhoto 9.6 / Ruby 2.2
in a ruby script, I am trying to open an xml file from the 'iPhoto Library' to get the album list.. but I got an error :
f = File.open(@xmlpath)
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/myself/Pictures/iPhoto%20Library/AlbumData.xml
first, I defined the 'iPhoto Library' path in my user path :
PhotoLib = File.expand_path(File.join("~","Pictures","iPhoto Library")
then I defined the @xml file path ( escaping the embedded spaces )
@xmlpath = URI.escape(File.join iPhotoLib, "AlbumData.xml")
finally I try to open the xml file
f = File.open(@xmlpath)
but it raises the 'No such file or directory' error... where am I wrong ? the file exists in the "iPhoto Library" content ...