Skip to content

Bug/Feature Request: return full absolute path with --getopenfilename and --getsavefilename #4

@scott092707

Description

@scott092707

When I use --getsavefilename and [startDir], the full filename returned by pydialog is not the full absolute path.

If I use [startDir] as /home/scott, and then write in aaa.txt, I get:
./aaa.text instead of:
/home/scott/aaa.txt

If I use [startDir] as /home/scott, and then select Documents/ComputerRelated, and write in aaa.txt, I get:
Documents/ComputerRelated/aaa.txt, instead of:
/home/scott/Documents/ComputerRelated/aaa.txt

If I use [startDir] as /home/scott, and then I go up to / and then select /lib32 and enter aaa.txt, I get:
../../lib32/aaa.txt instead of
/usr/lib32/aaa.txt

I don't know if this is a bug, or it is intended to use what I suppose would be called relative addressing.

I have so far gotten around this by discovering 3 commands and applying them, to achieve the full absolute path:

dir=$(dirname $WFR_FileName)
base=$(basename $WFR_FileName)
WFR_FileName=$(readlink -f "$dir/$base")  # note the added '/' between the dir and base

One COULD, perhaps, add an argument --use-absolute-path or --use-relative-path ... depending on how you want to default the path style...

[I have not used the --getopenurl or --getsaveurl or --getexistingdirectory, to know if the situation is the same,
but it seems likely.]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions