Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File is not readable or doesn't exist #1

Open
dmpop opened this issue Mar 21, 2017 · 4 comments
Open

File is not readable or doesn't exist #1

dmpop opened this issue Mar 21, 2017 · 4 comments

Comments

@dmpop
Copy link

dmpop commented Mar 21, 2017

Running digikam-select on openSUSE 42.2 results in the following error:

ruby digikam-select.rb -i /home/dmpop/Pictures/digikam4.db -o /home/dmpop/Pictures/export/ -r5
{:albums=>true,
 :mode=>"copy",
 :inputdb=>"/home/dmpop/Pictures/digikam4.db",
 :output=>"/home/dmpop/Pictures/export",
 :minrating=>"5"}
ERROR: File /dmpop/Pictures/20150531-161618.jpeg is not readable or doesn't exist
ERROR: File /dmpop/Pictures/20170128-133219.jpeg is not readable or doesn't exist

Both files exist in the specified directory.

@jensb
Copy link
Owner

jensb commented Mar 21, 2017

That's strange. This error will only appear if the source file fails both File.exist?(f) and File.readable?(f) in Ruby. Do the access modes (post output of ls -la) really match?
What does ruby -e 'puts File.readable?("/dmpop/Pictures/20150531-161618.jpeg")' return?

@dmpop
Copy link
Author

dmpop commented Mar 21, 2017

ruby -e 'puts File.readable?("/dmpop/Pictures/20150531-161618.jpeg")' returns false, but ruby -e 'puts File.readable?("/home/dmpop/Pictures/20150531-161618.jpeg")' returns true. This leads me to believe that the missing /home is the culprit.

@jensb
Copy link
Owner

jensb commented Mar 21, 2017

Probably. Can you rerun with -v? (empty destination dir beforehand)
Also activate (uncomment) line 196 in the script (debug 2, file.inspect, ...) before hand. Thanks!

@dmpop
Copy link
Author

dmpop commented Mar 22, 2017

Enabled debugging, then ran ruby digikam-select.rb -i ~/Pictures/digikam4.db -v Here is the output:

{:albums=>true,
 :mode=>"copy",
 :inputdb=>"/home/dmpop/Pictures/digikam4.db",
 :debug=>2}
#<SQLite3::Database:0x00000000b54078>
SELECT DISTINCT r.specificPath AS root, a.relativePath AS path, i.name AS name
    FROM Images i
    LEFT JOIN ImageTags it ON it.imageid = i.id
    LEFT JOIN ImageInformation ii ON ii.imageid = i.id
    LEFT JOIN Tags t ON it.tagid = t.id
    LEFT JOIN Albums a ON i.album = a.id
    LEFT JOIN AlbumRoots r ON albumRoot = r.id
    WHERE root != '' AND path != ''  
Found 2 matching images.
- {"root"=>"/dmpop/Pictures", "path"=>"/", "name"=>"20150531-161618.jpeg"}
ERROR: File /dmpop/Pictures/20150531-161618.jpeg is not readable or doesn't exist
- {"root"=>"/dmpop/Pictures", "path"=>"/", "name"=>"20170128-133219.jpeg"}
ERROR: File /dmpop/Pictures/20170128-133219.jpeg is not readable or doesn't exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants