Skip to content

different behavior in read function #455

@0x501D

Description

@0x501D
  • GopherLua version : 2b3f02d
  • go version go1.21.1 linux/amd64
  • Linux 6.5.4-gentoo-x86_64

code:

file = "/tmp"                                                                            
fd, _, code = io.open(file, "r")                                                          
_, _, ecode = fd:read(1)                                                                  
print(ecode) 

Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio:

$ lua ~/tmp/f.lua
21

Gopher-lua:

   ⨯ extra/wrapper.lua:17: read /tmp: is a directory
stack traceback:
	[G]: in function 'read'
	extra/wrapper.lua:17: in function 'exec'
	<string>:1: in main chunk
	[G]: ?

Lua works fine, gopher lua throws an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions