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

error: Significant trailing slashes - remote box uses local filesystem to get info about file! #7

Open
al6x opened this issue Oct 8, 2010 · 0 comments

Comments

@al6x
Copy link

al6x commented Oct 8, 2010

Hi Adam, thanks for another cool tool.

It seems to me that there's some strange behavior with trailing slashes. In case if you are working on remote machine, it uses local filesystem to determine whether this is file or not?!
Here's the code:

...
def self.factory(full_path, box=nil)
    if full_path.tail(1) == '/'
        Rush::Dir.new(full_path, box)


    # No matter is it remote box or local, it   
    # always uses local filesystem!
    elsif File.directory?(full_path) 


        Rush::Dir.new(full_path, box)
    else
        Rush::File.new(full_path, box)
    end
end
...

Maybe it's better to use something like that?

...
def self.factory(full_path, box=nil)
    if full_path.tail(1) == '/'
        Rush::Dir.new(full_path, box)
    elsif box.host == "localhost" 
        File.directory?(full_path) ? make_dir : make_file           
    else
        RemoteFile.directory?(full_path) ? make_dir : make_file

        # or, if it's expensive to query remote PC, just return file whithout any check?
        just_make_file
    end
end
...

P.S.
I think this tool deserves much more adoption, maybe some people tried but then have been stopping using it because of the need to start the rushd process.
Maybe it's worth to add ability for it to works with limited functionality but without starting rushd processes?

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

1 participant