]> git.sesse.net Git - vlc/blob - share/lua/http/requests/browse.xml
Mozilla : use \n
[vlc] / share / lua / http / requests / browse.xml
1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
2 <?vlc --[[
3 vim:syntax=lua
4 <!--  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
5 <  status.xml: VLC media player web interface
6 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
7 <  Copyright (C) 2005-2006 the VideoLAN team
8 <  $Id$
9
10 <  Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
11
12 <  This program is free software; you can redistribute it and/or modify
13 <  it under the terms of the GNU General Public License as published by
14 <  the Free Software Foundation; either version 2 of the License, or
15 <  (at your option) any later version.
16
17 <  This program is distributed in the hope that it will be useful,
18 <  but WITHOUT ANY WARRANTY; without even the implied warranty of
19 <  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 <  GNU General Public License for more details.
21
22 <  You should have received a copy of the GNU General Public License
23 <  along with this program; if not, write to the Free Software
24 <  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
26 ]] ?>
27
28 <root>
29 <?vlc
30 local dir = _GET["dir"]
31 if dir then
32   if dir == "~" then dir = vlc.homedir() end
33   dir = common.realpath(dir.."/")
34   local d = vlc.fd.opendir(dir)
35   table.sort(d)
36   for _,f in pairs(d) do
37     if f == ".." or not string.match(f,"^%.") then
38       local df = common.realpath(dir..f)
39       local s = vlc.fd.stat(df)
40       local path, name = vlc.convert_xml_special_chars( df, f )
41       print("<element type='"..s.type.."' size='"..s.size.."' path='"..path.."' name='"..name.."'/>\n")
42     end
43   end
44 end
45 ?>
46 </root>