Sha256: 9ca9df2b9c922e1dd7a6c0c929dfead85e48c043dc5da73a1288f67f6f9894b8

Contents?: true

Size: 816 Bytes

Versions: 5

Compression:

Stored size: 816 Bytes

Contents

module Windows
  module Limits
    private

    MINCHAR  = 0x80
    MAXCHAR  = 0x7f
    MINSHORT = 0x8000
    MAXSHORT = 0x7fff
    MINLONG  = 0x80000000
    MAXLONG  = 0x7fffffff
    MAXBYTE  = 0xff
    MAXWORD  = 0xffff
    MAXDWORD = 0xffffffff
      
    # For wide character functions the actual path limit is actually 32k
    # for most functions that deal with paths, but in the interests of not
    # wasting huge chunks of memory on buffers I limit it to 1k, which
    # should be more than enough in practice.
    #
    if RUBY_VERSION.to_f >= 1.9
      if __ENCODING__.name == 'UTF-8'
        MAXPATH = 1024
      else
        MAXPATH = 256
      end
    else
      if $KCODE == 'UTF8'
        MAXPATH = 1024
      else
        MAXPATH = 256
      end
    end
  end
end 

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
windows-pr-1.2.6 lib/windows/limits.rb
windows-pr-1.2.5 lib/windows/limits.rb
windows-pr-1.2.2 lib/windows/limits.rb
windows-pr-1.2.1 lib/windows/limits.rb
windows-pr-1.2.0 lib/windows/limits.rb