On Mon, 25 Oct 2010 08:19:35 -0500 "Edward K. Ream" <[email protected]> wrote:
> I have a bad feeling abouit this. I'm beginning to see why Python has > not solved this problem. > > Alas, any "solution" will be os-dependent. But that's not good: it > means that our efforts here simply make .leo files *less* portable > than before. > > This is not at all a code issue, it's a design problem. It seems intractable. It really applies only to Windows paths, un*x has no concept of current drive, and so the idea of a path relative to the root of the current drive makes no sense. So yes, it's os-specific windows only. So, you have a Leo file on a USB flash drive and that Leo file references a derived file in a Documents directory at the root of that drive. In Windows, you can't predict the drive letter under which the USB flash drive will be mounted, in Unix you can't predict the mount point (Ubuntu might use /media/disk-N where N varies, for example). In Unix, the only solution is a relative (to the current directory) path, i.e. ../../../Documents/somefile.py. *That would also work in Windows*. Windows also allows a cleaner and more robust form, \Documents\somefile.py. Cleaner because you don't have to try and count directory levels, and more robust because it doesn't break if the directory levels of the .leo file change. But, it requires some mildly complex code in Leo to support it. OTOH, I think the code is reasonably isolated. So, a design decision, include the code, or say only .. style paths are cross platform and supported by Leo, and point people to the Python bug if they use drive relative paths and MyAccountNumbers.txt gets written to C:\Documents instead of E:\Documents :-} Cheers -Terry -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
