azbycxdw909 / garglk

Automatically exported from code.google.com/p/garglk
Other
0 stars 0 forks source link

stream_open_file when opening a file from command-line #132

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download Alabaster at 
http://inform-fiction.org/I7Downloads/Examples/alabaster/Alabaster.zip
2. cd to dir and run "gargoyle Alabaster.zip"
3. Answer the prompt (When the prompt displays it produces a put_char error. 
Different bug)

What is the expected output? What do you see instead?
This error appears:

   Glk library error: stream_open_file: unable to open file (w): Alabaster.gblorb/alabstersettings

No settings file is created in the file's directory, as should be.

What version of the product are you using? On what operating system?

Latest, r464.

Please provide any additional information below.

When specifying any kind of path on the command line, the error doesn't appear. 
Examples:

gargoyle ./Alabaster.zip
gargoyle ../Alabaster.zip
gargoyle /path/to/Alabaster.zip

Original issue reported on code.google.com by saltyho...@gmail.com on 13 Nov 2010 at 7:23

GoogleCodeExporter commented 8 years ago
The problem is with glkunix_set_base_file().
Given filename "foo", it sets the workdir to "foo".

Is there any reason not to use dirname() for this? Portability, perhaps?

Original comment by saltyho...@gmail.com on 14 Nov 2010 at 9:01

GoogleCodeExporter commented 8 years ago
Why are you loading the zip file instead of extracting and loading the gblorb 
file?

Alabaster tries to write a file in its own directory and if the story file is 
run from inside a zip file, I would expect it to error out, since otherwise the 
archive would have to be rewritten in place.

dirname() does not work properly under MinGW. I will take a closer look at 
glkunix_set_base_file(), though.

Original comment by bcressey@gmail.com on 15 Nov 2010 at 1:23

GoogleCodeExporter commented 8 years ago
Whoopsy. I'm not actually running the zip file. I extract it and run the 
Alabaster.gblorb file inside.

I wrote that bug report manually, but as you see, the error mentions the gblorb 
file :)

Original comment by saltyho...@gmail.com on 15 Nov 2010 at 7:32

GoogleCodeExporter commented 8 years ago
Oh, OK. I figured maybe you had a tool that treated zip files as a transparent 
directory somehow.

I'll get glkunix_set_base_file() patched so it works in the case where Gargoyle 
runs in the same directory as the story file. That's not a case I usually check 
for in testing but it's definitely a bug. Thanks for catching it and tracking 
it down.

Original comment by bcressey@gmail.com on 17 Nov 2010 at 5:14

GoogleCodeExporter commented 8 years ago
Fixed in r495.

Original comment by bcressey@gmail.com on 25 Jan 2011 at 5:49