[vlc-devel] [PATCH] LUA script to read DCP

Pierre Villard pierre.villard.fr at gmail.com
Fri Mar 8 19:41:45 CET 2013

On 07/03/2013 16:36, Ilkka Ollakka wrote:
> Hi, I noticed that you use is_file() call in that script. But you 
> could just try is_dir() call to path to know directly if it's 
> directory name and exists in probe(). I don't really know the 
> underlying implementation of that is_dir() (just spotted it from short 
> googling) function and no idea if it does something unwanted.
Not sure there is such a function in Lua about directory (except if we 
make an assumption about the file system) :
The last post on the previous web page seems weird to me.
Having said that, maybe I didn't get your point.

About /is_file()/, Rémi Denis-Courmont noticed to me it could raise some 

    stat() MUST be used to check if a file exists and the file type MUST be
    checked. open()-then-close() is inefficient and prone to deadlock.

> for example something like this
> ---
> locale working_accesses = {file="true",directory="true"}
> if( working_accesses[vlc.access] == nil ) then
>      return false
> end
> ---
> Basicly return if access isn't in that table.
Yes you're right, I misread the README in playlist directory about 
vlc.access... >.<
New patch enclosed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130308/7aaa5029/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-LUA-script-to-read-DCP.patch
Type: text/x-patch
Size: 14694 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130308/7aaa5029/attachment.bin>

More information about the vlc-devel mailing list