Finding a writeable folder (FileSystemLayerImpl)

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 3
Contact:

Finding a writeable folder (FileSystemLayerImpl)

Post by AshMcConnell » Mon Apr 20, 2015 8:18 pm

Hi Folks,

I've started an alpha of my game ( http://onlineracingchampionship.com ) and I'm getting some error reports of it crashing because it can't write log and configuration files on Windows 7. If the user runs as admin it successfully writes into the c:\program files (x86)\ORC folder (rather than the Documents\OnlineRacingChampionship folder on Windows 8.1 (and some Windows 7 installs).

I am using Ogre's FileSystemLayerImpl that is used in the Samples, like so: -

Code: Select all

FileSystemLayerImpl *fs = new FileSystemLayerImpl("OnlineRacingChampionship");
return fs->getWritablePath(inPath);
Has anyone else had this problem? Any ideas what could be causing it?

Thanks for your help
All the best,
Ash
0 x

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7147
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 16

Re: Finding a writeable folder (FileSystemLayerImpl)

Post by Kojack » Tue Apr 21, 2015 1:35 am

I can't find FileSystemLayerImpl, only FileSystemLayer, which should use SHGetFolderPathW with CSIDL_PERSONAL to get a valid writable directory. Is the Impl version from a different platform?
0 x

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 3
Contact:

Re: Finding a writeable folder (FileSystemLayerImpl)

Post by AshMcConnell » Wed Apr 22, 2015 9:25 pm

Kojack wrote:I can't find FileSystemLayerImpl, only FileSystemLayer, which should use SHGetFolderPathW with CSIDL_PERSONAL to get a valid writable directory. Is the Impl version from a different platform?
I seem to have taken that file from a previous version of Ogre. Not sure why I did that to be honest ;), perhaps to reduce dependencies to my Utils library. So in summary, I'm an idiot - I'll go look at the latest version and hopefully that will work :)
0 x

Post Reply