I have the following lines in my rifle.conf for reading pdf files:

ext pdf, has foxitreader,   X, flag f = foxitreader -- "$@"
ext pdf, has evince,   X, flag f = evince -- "$@"
ext pdf, has zathura,  X, flag f = zathura -- "$@"

When I then use ranger to navigate to a pdf file, and hit Enter, foxitreader automatically starts, but gives an error, stating that the pdf file was not found:

File not found.
Check if the file was moved,renamed,or deleted.

Naturally I tried many different pdfs to the same effect. Moving the evince or zathura lines to a higher priority in my rifle.conf opens the same pdf files successfully with those programs. Running foxitreader from bash opens the pdf files successfully:

$ foxitreader /path/to/pdf

I noticed in the foxitreader error message that there's a ; prepended to the file's path (see above). Is that the problem? The rifle.conf entry for foxitreader is written exactly the same as for evince and zathura, and they don't have any problems opening the pdfs. So what's the problem?

  • What if you try foxitreader -- '/home/finn/Documents/Education/Algorithms_Data_Structures/Art_of_Computer_Programing/Art_of_Computer_Programming_(Volume_1)_(2005).pdf'? – roaima Jan 17 '18 at 17:03
  • @roaima Putting the command you just mentioned in bash, gives the same exact error message. Is this a bug in foxitreader? – Nadim Hussami Jan 17 '18 at 17:05
  • Ah! If you omit the -- it works? Then remove that from your configuration too. – roaima Jan 17 '18 at 17:07
  • @roaima I tried that the first time, and it didn't work. But now that trick seems to have fixed it! Do you want to post the answer so I can accept it for you? – Nadim Hussami Jan 17 '18 at 17:10

Based on a brief discussion in the comments, it appears that foxitreader does not like the -- separator

  • This fails with the same error message: foxitreader -- '/path/to/file.pdf'
  • This succeeds: foxitreader '/path/to/file.pdf'

The empirical solution is to omit the -- separator for foxitreader in the rifle.conf configuration file.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.