lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 11/09/2007 18:23, Luc1an0 wrote:
Yes, I always use the double backslashes !!  It's obliged in Lua on Windows

Not necessarily, forward slashes are OK in NT:

	local fh = io.open("E:/temp/SomeTestFile.txt", "w")
	fh:write("Simple test string\n")
	fh:close()

or, if you prefer, just use long string syntax:

	local fh = io.open([[E:\temp\SomeTestFile.txt]], "w")

Ugly double backslashes are a fatality only in languages with only one way of writing literal strings, like C/Java...

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --