Hello,

First, please understand that I am not a LUA programmer, so use this
code with caution. It is my hope that one of the mainstream developers
for this package will review the code below and incorporate it into a
future build.

Some of us who are on corporate networks get some or all of our folders
redirected to a network location and that causes SqueezePlay to fail to
start. A UNC (Universal/Uniform Naming Convention) is like
\\server\share\path\... Where server is the name of the server, and
share is the name of the published shared to access--you can't do a
mkdir on these parts of the name, they must pre-exist.

I opened "C:\Program Files
(x86)\Squeezebox\SqueezePlay\lua\jive\AppletManager.lua" (drop the "
x86" if your Windows is 32-bit). If you are attempting this on your
own, you may need to make a copy of the file somewhere else so you can
save it. When done with the changes, copy it back to this location.
MAKE A BACKUP FIRST!!!

I then updated _mkdirRecursive as below. In my version, it starts on
line 98. If you have an older or newer version, then it may be
somewhere else.

REMEMBER, I am NOT a LUA programmer, nor have I touched SqueezePlay
source before--use with caution!

Sorry about the lack of formatting, I am not sure how to force the post
to keep the indentation.

function _mkdirRecursive(dir)
--normalize to "/"
local dir = dir:gsub("\\", "/")
local dirPrefix = dir:sub(1,2)
local isUnc = false
if dirPrefix == "//" then
        isUnc = true
end

local newPath = ""
for i, element in pairs(string.split('/', dir)) do
newPath = newPath .. element
              if isUnc and i > 4 or not isUnc and i ~= 1 then --first element
is (for full path): blank for unix , "<drive-letter>:" for windows
if lfs.attributes(newPath, "mode") == nil then
log:debug("Making directory: " , newPath)

local created, err = lfs.mkdir(newPath)
if not created then
error (string.format ("error creating dir '%s'
(%s)", newPath, err))
end     
end
end
newPath = newPath .. "/"
end
end


-- 
PhxJim
------------------------------------------------------------------------
PhxJim's Profile: http://forums.slimdevices.com/member.php?userid=45408
View this thread: http://forums.slimdevices.com/showthread.php?t=86828

_______________________________________________
jive mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive

Reply via email to