tldr: Having trouble getting the target of symlinks within a specified directory. My apologies for a very newbish question here. Background: As a learning exercise I want to write a program that will sync folders between my desktop and my Android phone using `adb push`. I know there are already apps that do this, but it seems a nice starter project to learn something from. I have a script that will create a hidden desktop directory for each type of file to be synced (music, pictures, movies, etc). I have a script that will provide an entry on right click menus for "sync to android" with sub-entries for each category. This creates a symlink to the selected file or directory in the "sync" directory. Problem: adb push does not work with symlinks. I need my "sync" script to read over the symlinks in the sync directories and return the target paths to `adb push`. I have tried any number of ways to make this happen and come up short. Any assistance is needed. Examples of things that do not work below: Pathname("/#{Dir.home}/.ANDROIDMUSIC").each_entry.realpath => 'foreach': no block given (LocalJumpError) Dir.foreach("/#{Dir.home}/.ANDROIDMUSIC") { |entry| Pathname(entry).realpath } => in 'realpath': No such file or directory - /current/directory/with_file_from_specified_directory_appended.mp3 -- Posted via http://www.ruby-forum.com/.