Bugzilla – Bug 14780
readdir() and other Lua methods are not cross-platform, particularly with windows
Last modified: 2011-01-14 11:29:14 UTC
All of the wallpapers are installed, but Settings > Screen > Wallpaper offers a blank menu to choose from. You can change the wallpaper only by manually editing \userpath\settings\SetupWallpaper.lua.
Ben: this one yours to fix?
this is a windows build problem. probably a dup with a few others re: windows squeezeplay, but i'll leave it open for now.
Created attachment 6126 [details] new readdir for windows Coincidentally I was looking at this today. It's a problem with / when using readdir. Unfortunately, not sure how to make this cross-platform. The trailing slash can't be there for windows either, as it fails when using lfs.attributes so you have to add it later. All I can find for OS detection in jive lua so far is getMachine and getArch and I'm not sure if we can isolate windows software with just that given that you can run lots of oses on i386 to run squeezeplay software.
Created attachment 6127 [details] detect windows and modify where needed. This detects windows based on something I found elsewhere. Can't require os or string in Applet.lua so it has to be detected elsewhere and passed. This may not be the right place to do it, but this does seem to do what's required to make wallpapers work. Other places where readdir is used won't benefit from this until detection is instead done at higher level, and in something that CAN be loaded in Applet.lua
We need to make sure we have a cross-platform solution for any filepaths and not hardcode / in the construction of paths. That's the root issue of this bug, so changing the summary to reflect that.
Created attachment 6135 [details] easier fix. Looks like the slash problem is not quite what it seemed. While it looked nutty to have the slashes mixed, it's really just the trailing slash that has to be delayed so that attributes can return a valid value. Haven't tested on osx or linux as I cannot get local builds to complete without compiler errors.
== Auto-comment from SVN commit #7880 to the jive repo by bklaas == == https://svn.slimdevices.com/jive?view=revision&revision=7880 == Bug: 14780 Description: patch from KDF (thanks!) to deal with windows-specific issue with readdir() reviewed and tested against OS X with no issue
Moving lower-priority bugs to next target
Tom is no longer available to us
Isn't this one fixed? I'm assuming so unless told otherwise.