Skip to content

When creating a symbolic link JRuby give bad error message when not an admin on windows #4765

@cshupp1

Description

@cshupp1

This issue is closely related to issue:
#4669

On today's build (and many previous release versions) when making a symlink in a non admin shell you get a poor error message. Consider:

>  java -jar C:\work\va-ctt\jruby\jruby\maven\jruby-complete\target\jruby-complete-9.1.13.0-SNAPSHOT.jar -S jirb                         
irb(main):001:0> File.symlink('c:\temp\del.me', 'c:\temp\del2.me')                                                                       
SystemCallError: Unknown error (SystemCallError) 1314 - CreateSymbolicLink                                                               
        from uri:classloader:/jruby/kernel/file.rb:115:in `symlink'                                                                      
        from (irb):1:in `<eval>'                                                                                                         
        from org/jruby/RubyKernel.java:1000:in `eval'                                                                                    
        from org/jruby/RubyKernel.java:1298:in `loop'                                                                                    
        from org/jruby/RubyKernel.java:1120:in `catch'                                                                                   
        from org/jruby/RubyKernel.java:1120:in `catch'                                                                                   
        from uri:classloader:/META-INF/jruby.home/bin/jirb:13:in `<main>'                                                                

MRI ruby will give:

irb(main):003:0> File.symlink('c:\temp\del.me', 'c:\temp\del2.me')
Errno::EACCES: Permission denied @ rb_file_s_symlink - (c:\temp\del.me, c:\temp\del2.me)
        from (irb):3:in `symlink'
        from (irb):3
        from c:/languages/ruby/Ruby24-x64/bin/irb.cmd:19:in `<main>'

React on Rails makes use of these APIs and it would be nice to get a useful error message in the build to clue the developer in to run the build as an admin.

Thanks,
Cris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions