Ticket #137 (closed bug: fixed)

Opened 1 year ago

Last modified 5 months ago

File handling cleanup

Reported by: takkaria Assigned to: elly
Milestone: 3.1.0 Version:
Keywords: cleanup Cc:

Description (Last modified by takkaria)

Main priority here is to design a single API for file access, and behind it write the code for specific systems.

Other thoughts:

  • init font/graf/sound directories globally at the beginning
  • allocate all pathnames dynamically (no buffer-too-short problems)
  • all pathnames should always be stored system-specific and absolute (and so only one place needs filename translation)

Also see #137, for platform-independent directory creating code.

Attachments

rough.patch (113.8 kB) - added by takkaria on 08/08/07 21:47:20.
This compiles and works on Linux (at least). Contains unit tests.
works-on-win-no-tests.diff (110.5 kB) - added by takkaria on 08/09/07 08:21:03.
Got it working on Win XP

Change History

06/03/07 12:28:44 changed by takkaria

  • keywords set to cleanup.

08/03/07 08:15:31 changed by takkaria

  • description changed.
  • summary changed from Audit file handling code to File handling cleanup.

08/03/07 09:16:59 changed by takkaria

  • owner set to elly.

08/03/07 17:47:08 changed by takkaria

API available, though it's changed a little bit while implementing.

Will take a while to filter into the game, just because it's taking a while to rename everything to use the new functions.

08/08/07 09:17:55 changed by takkaria

  • description changed.

08/08/07 20:08:41 changed by takkaria

It's getting close.

08/08/07 21:47:20 changed by takkaria

  • attachment rough.patch added.

This compiles and works on Linux (at least). Contains unit tests.

08/08/07 21:52:20 changed by takkaria

With aforementioned patch:

  • RISC OS is broken for sure
  • Macs might be a little broken
  • Windows should be OK but is untested

A umask() call needs adding for Unix platforms with bad defaults. OS X needs a converter between Angband filetypes and OS X filetypes.

Note that the unit tests aren't *quite* 100% coverage, but they're pretty close. Main omission is anything for the "append" mode.

08/09/07 08:21:03 changed by takkaria

  • attachment works-on-win-no-tests.diff added.

Got it working on Win XP

08/09/07 08:22:02 changed by takkaria

That patch functions on Windows (properly!) but untested on anything else. Other issues still apply.

08/09/07 10:13:27 changed by takkaria

[469] and [470] contain the file API changes. Initing font/graf/sound directories globally at the beginning would still be nice, but not sure the gain is worth it.

Documentation to follow in header file.

08/09/07 10:55:01 changed by takkaria

  • status changed from new to closed.
  • resolution set to fixed.

Documented in [474]. Closing as fixed; this cleanup is "done". Please file new bugs for fallout on e.g. OS X.

05/17/08 09:24:53 changed by takkaria

  • milestone changed from 3.2.0 to 3.1.0.

Add/Change #137 (File handling cleanup)




Action