Murga-Projects Forums

Full Version: New murgaLua 0.5.5 release !!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On Slackware Linux i see what faughanvale sees.
0.5 sleeps milliseconds
0.5.5 sleeps seconds

I might also mention that they are both apparently written with milliseconds in mind, as I get this error in both versions when using an improper argument:
/usr/bin/murgaLua-0.5.5: [string "murgaLua"]:155: bad argument #1 to 'sleepMilliseconds' (number expected, got string)
FWIW. This patch (using usleep instead of nanosleep directly) in luasocket-2.0.1/src/timeout.c seems to work for me (Cygwin, using X11 and not Win32).

Doug@DOUGS_XP ~/murgalua/murgaLua/3rd-party/luasocket-2.0.1/src

$ diff timeout.c.bak timeout.c
19a20
> #include <unistd.h>
21a23
>
198,206c200
< struct timespec t, r;
< t.tv_sec = (int) n;
< n -= t.tv_sec;
< t.tv_nsec = (int) (n * 1000000000);
< if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999;
< while (nanosleep(&t, &r) != 0) {
< t.tv_sec = r.tv_sec;
< t.tv_nsec = r.tv_nsec;
< }
---
> usleep((useconds_t) n * 1000000 );
221,229c215
< struct timespec t, r;
< t.tv_sec = (int) n;
< n -= t.tv_sec;
< t.tv_nsec = (int) (n * 1000000);
< if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999;
< while (nanosleep(&t, &r) != 0) {
< t.tv_sec = r.tv_sec;
< t.tv_nsec = r.tv_nsec;
< }
---
> usleep((useconds_t) n * 1000 );
I know where the bug with sleep is ... I accidentally backed out a good change ...

I am in Yalta on holiday right now, but expect 0.6 to come out some time in the next couple of weeks.

Sorry, no time to write any more, gotta catch some rays ...

Cheers
JohnM
Sorry for not noticing this earlier but the iPakk phase of the MacOS-Intel build turns it into a PowerPC exeutable.

Not sure what happened there or why, but thought you should know so the next version can avoid this.
I just stumbled on this a moment ago.
MurgaLua doesn't have an internal version number, as in some way to get the murgaLua version from within murgaLua. If I'm wrong and it does now have this, it didn't before so it won't be of much use until no one uses previous versions anymore.

So anyway, to my point....

You can check for murgaLua version 0.5.5 and newer from a script without causing troubles for older versions by checking for one of the libraries added to 0.5.5. lua filesystem, for example:

Code:
if package.loaded["lfs"] then
  do some lfs.* stuff
else
  do some murgaLua.* stuff
end


This allows you to use both lfs.* and murgaLua.* for file handling in the same script, so the end user does not have to have a particular version of murgaLua or a particular version of a script.

Pages: 1 2
Reference URL's