1. Bug in Euphoria for Linux?

In Euphoria for Linux, the ~ character apparently doesn't work. I
created a program in my home directory called test.exu:

integer f
f = open("~/test.exu","r")
if f = -1 then
        puts(1,"f = -1\n")
        abort(0)
end if
close(f)

When I run it, it displays f = -1.

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

new topic     » topic index » view message » categorize

2. Re: Bug in Euphoria for Linux?

Jeffrey Fielding writes:

> In Euphoria for Linux, the ~ character apparently doesn't work.
> I created a program in my home directory called test.exu:
> integer f
> f = open("~/test.exu","r")
> if f = -1 then
>        puts(1,"f = -1\n")
>        abort(0)
> end if
> close(f)
> When I run it, it displays f = -1.

I believe the '~' character is a special feature of
the Linux shell that you are using. It's not a part
of the underlying file system, so it doesn't
mean anything to the open() command.

~ seems to be equivalent to $HOME
so you could do:

        tilde = getenv("HOME")

        f = open(tilde & "/test.exu", "r")

Regards,
     Rob Craig
     Rapid Deployment Software
     http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu