angband-import / angband-trac

Test importing Trac events into Angband
0 stars 0 forks source link

Create missing directories on startup #58

Closed angband-import closed 4 years ago

angband-import commented 4 years ago

Reported by takkaria on 21 Mar 2007 15:21 UTC If we can, and if they're missing.

This will require portable "create directory" code. If we don't create them, a verbose explanation should be given of what the user must do to make the game work. The Windows port would benefit from this especially, as we could stop distributing delete.me files.

angband-import commented 4 years ago

Modified by takkaria on 3 Jun 2007 16:18 UTC

angband-import commented 4 years ago

Modified by takkaria on 24 Dec 2007 01:31 UTC

angband-import commented 4 years ago

Modified by magnate on 26 Jul 2009 18:29 UTC

angband-import commented 4 years ago

Comment by magnate on 15 Nov 2009 22:00 UTC Bringing this forward in the hope that this will fix the residual niggle from #134, to save me finding an alternative solution ...

angband-import commented 4 years ago

Comment by non on 15 Nov 2009 22:38 UTC So, thanks to MarbleDice's testing, I think I can write some coding using mkdir() and stat() that will run on Windows and on POSIX systems. Which other platforms are we hoping to support?

Anyway, i will add the appropriate functions to z-file.c first and then talk to Magnate about how to proceed.

angband-import commented 4 years ago

Comment by non on 16 Nov 2009 07:15 UTC As of [7395c6e] (SVN r1731) I have added dir_exists() and dir_create() which should be "cross-platform enough" for our purposes (windows and POSIX systems). dir_create() is recursive so hopefully it will prove useful.

I have tested these functions on Linux but I'd like to get more testing on Windows.

I'm leaving this bug open since these functions aren't actually used yet.

angband-import commented 4 years ago

Comment by magnate on 16 Nov 2009 22:12 UTC The more I think about it, the more I think these functions should be called from just one place - in init2.c. All existing uses of mkdir occur there - the existing function is called create_user_dirs but it could be expanded to create_needed_dirs. It's currently called only by main.c and main-crb.c. Once we leave that function, we should have created all the dirs we'll ever need. The one possible exception is info/, which should only be created on the installation of spoilers - but I say that as a package manager, and if Takk wants the game to create info/ too that's fine with me - it's enough for me that it's not created by make install.

angband-import commented 4 years ago

Comment by magnate on 17 Nov 2009 07:58 UTC In fact, I am having second thoughts about removing info/ from the install process. According to Debian policy it's actually ok to create empty dirs, if you expect users to put something in them. Unzipping spoiler files pretty clearly meets this expectation. So by all means let's include info/ in create_needed_dirs.

angband-import commented 4 years ago

Comment by magnate on 18 Nov 2009 11:15 UTC [c99c742] (SVN r1733). I assumed that file/, edit/, pref/ and xtra/ will always need to exist, but it's easy enough to add them to create_needed_dirs if necessary. Now to tidy up the installation and get rid of the delete.me files.

angband-import commented 4 years ago

Comment by magnate on 18 Nov 2009 13:02 UTC [52ab8d5] (SVN r1734) removes the delete.me files, but we're not quite done yet:

games/angband: Cannot create /home/chrisc//.angband/Angband

Need to check for the tilde expansion and avoid the extra slash.

angband-import commented 4 years ago

Comment by magnate on 18 Nov 2009 15:23 UTC [b4a05a4] (SVN r1736).