Menu

#302 Relative Path Handling Issue in Dataset Storage

v1.0_(example)
closed-fixed
nobody
None
5
2024-03-29
2024-03-29
No

Hi,

Description

When attempting to store a dataset using relative paths, the filenames are being ignored, and the created files are instead named ".bin" and ".idx". This issue does not occur when providing absolute paths for storage. This behavior is unexpected and inconsistent, leading to an inability to open the stored dataset subsequently.

Expected Behavior

When storing a dataset with a relative path, the specified filename should be respected, and the files should be named accordingly (e.g., "data.bin" and "data.idx").

Actual Behavior

Files are named ".bin" and ".idx" when stored using a relative path, ignoring the provided filename. This does not occur when an absolute path is used.

Environment

Current git-version using Ubuntu 22.04.

Code Example

set verbose off
set workdir "/home/artur/tmp/gretl_db" # set some path

open australia.gdt --quiet
string filename = "./data.bin"
store "@filename" --overwrite   # Error: names of files: ".bin" and ".idx"

open "@filename"  # Fails as the filenames were not correctly stored

Suggested Workaround

As a temporary workaround, users can specify absolute paths when storing datasets to ensure correct filename usage.

Best
Artur

Discussion

  • Allin Cottrell

    Allin Cottrell - 2024-03-29

    Leave off the leading "./" and this works OK.

     
  • Allin Cottrell

    Allin Cottrell - 2024-03-29
    • status: open --> closed-fixed
     
  • Allin Cottrell

    Allin Cottrell - 2024-03-29

    Bad behavior when the specified filename starts with '.' is now fixed in git.

     

Log in to post a comment.