开发者

Lua - Accessing files & controlling applications?

How would a person use the Lua scripting language to do things such as this:

Opening an application such as IE and controlling it, accessing the C drive and the current directory that the .lua file is located to modify, move, create and delete files.

Any links to references for this would be appreciated, I cannot find any 开发者_高级运维clear documentation anywhere.


Generally speaking, Lua doesn't have this kind of stuff built-in. Lua is a minimalist programming language, great for embedding. The core language only uses facilities available in C89. If you want bells and whistles, you need to add Lua libraries.

You can find libraries by searching the wiki, at luarocks, luadist, or luaforge

For "controlling IE" you should take a look at LuaCom

For accessing the current directory, try LuaFileSystem


I'll add to Doug's correct answer the observation that you might be better off not attempting to control IE if the actual goal is just to fetch web pages at the whim of a script. For that, a library like cURL is a much better choice, and there is a binding to it for Lua known as luacurl.

That binding, along with all of the bindings mentioned by Doug are available as part of the Lua for Windows distribution. Reading between the lines, you are most concerned about the Windows platform, so that distribution should be your starting point.

If you plan to integrate Lua with C# and other .NET languages, then you will want to investigate LuaInterface as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜