[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Issue using quoted arguments on os.execute() on Windows
- From: Paul K <paulclinger@...>
- Date: Sun, 17 Nov 2013 15:09:01 -0800
Hi Thijs,
> I had just devised the following workaround; replace the full path by its short version;
> So I wouldn't have to quote the command itself. But yours is better and universally
> applicable (I can monkeypatch os.execute() with that, and rest assured it works
> everywhere).
If you don't mind using an external module, then winapi provides
short_path function that returns proper short path for a filename:
require("winapi")
winapi.set_encoding(winapi.CP_UTF8)
filepath = winapi.short_path(filepath)
I do like Peter's clever solution though.
Paul.