Home page logo

wireshark logo Wireshark mailing list archives

Re: Add-on Lua code for file system operations?
From: Hadriel Kaplan <hadriel.kaplan () oracle com>
Date: Fri, 7 Feb 2014 22:31:50 -0500

On Feb 7, 2014, at 8:04 PM, Guy Harris <guy () alum mit edu> wrote:

There's a LuaFileSystem package:


that presumably uses standard UN*X calls on UN*Xes and appropriate Windows calls on Windows.

We also have our own wrappers in the wsutil library for some file system operations.

Should we either bundle the LuaFileSystem stuff, at least on platforms where we bundle Lua with Wireshark rather than 
relying on the OS to have it as a package (I guess the packager could make the appropriate Wireshark package depend 
on the LuaFileSystem package, if one exists), or do our own Lua extensions using the wsutil routines?

LFS is kinda heavy for our needs I think.  Fwiw, there’s already a wslua 'Dir' class available via wslua_util.c, though 
it only provides directory filename iteration.  It just maps to glib’s GDir.

The latter may handle non-ASCII pathnames better on Windows - a quick look at the LuaFileSystem seems not to indicate 
that it does any UTF-8-to-UTF-16 mapping, it just calls _mkdir(), but we map UTF-8 to UTF-16 and call _wmkdir().  

In fairness to LFS, Lua itself doesn’t really handle unicode very well.

It also matches what we do in C/C++ code in Wireshark.

Yeah, that’s probably the safest route.


Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]