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 16
Contact:

Finding a writeable folder (FileSystemLayerImpl)

Post by AshMcConnell »

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
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: Finding a writeable folder (FileSystemLayerImpl)

Post by Kojack »

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?
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 16
Contact:

Re: Finding a writeable folder (FileSystemLayerImpl)

Post by AshMcConnell »

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 :)
Post Reply