Way to get relative pathpart of a file?
Posted: Thu Oct 24, 2024 8:01 pm
I am using FileRequest in my program, and then save the result to be used later, however, I just realised that instead of having relative path, like "Pictures/filename.img" it is actually saving them as "C://hollywoodprogs/Pictures/Filename.img", and I am now wondering if there is some simple way, a command to have the relative path instead of the full path when using FileRequest.
Like I would like it to start from the directory where program is started from, and then save relative path from that point when I use filerequest.
I can see there is PathPart(), FilePart(), and GetCurrentDirectory(), but is there anything like RelativePathPart() existing, or do I have to make one myself using PathPart() and GetCurrentDirectory()? I am mainly worried that doing one myself could result in unexpected behavior when using program in different machines/directories.
Like I would like it to start from the directory where program is started from, and then save relative path from that point when I use filerequest.
I can see there is PathPart(), FilePart(), and GetCurrentDirectory(), but is there anything like RelativePathPart() existing, or do I have to make one myself using PathPart() and GetCurrentDirectory()? I am mainly worried that doing one myself could result in unexpected behavior when using program in different machines/directories.