".." in Folder List

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bhall2001
Posts: 107
Joined: Thu Oct 30, 2014 3:54 pm
Location: Manchester, NH

".." in Folder List

Post by bhall2001 » Mon Nov 23, 2015 4:33 pm

Today's issue of This Week In Livecode (TWILC) pointed to an interesting bug report that got my attention. I've started a project to bring HMVC to revIgniter which relies on ".." to walk directories. My project is based on 2 Codeigniter HMVC projects that use ".." to walk the servers directories to get files. I've also used this technic on other Webserver applications to get to files from a relative location.
So, yes, '..' should appear in 'the folders' for all platforms... However, I think it should be filed as an anomaly that it does (it shouldn't appear on any platforms as it communicates no useful information at all!)
@mwieder
mwieder commented on Oct 19
Au contraire... I rely on this for directory walking.
@peter-b
Collaborator
peter-b commented on Oct 19
@mwieder Well, you shouldn't.
My question is this. I think I read in the bug report that ".." will remain in the Folders List as valid for backwards compatibility. But I believe web app scripting does use and expects ".." to be a valid path and that this is a valid method to traverse directories especially in a web application script.

Am I wrong with this?
And more importantly, not using ".." for path traversal will mean that my solution of HMVC for revIgniter will be more "invasive" to the core revIgniter framework. Do I need to go back and re-think how I've implemented directory traversals in HMVC revIgniter?

Bug report reference: https://github.com/livecode/livecode/pull/3073

Thanks in advance,
Bob

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: ".." in Folder List

Post by FourthWorld » Mon Nov 23, 2015 5:58 pm

If I read that thread correctly, all that was proposed was removing ".." from the list of folders returned from "the folders" function. Wherever ".." is a valid part of a path (pretty much everything below root) it would remain so. Scripts relying on relative paths like "../somefolder/somefile" would continue to work.

The only thing affected would be we'd no longer have to filter out ".." from our folder lists, which seems a good thing to me, since that's just an extra step we've been needing to do, and I don't know anyone who's relied on ".." being there. and even in the rare case that someone wants it, it's fewer clock cycles to add it to the folder list than it is to remove it, so it's both more convenient for most use cases and faster in the few use cases where it's needed.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bhall2001
Posts: 107
Joined: Thu Oct 30, 2014 3:54 pm
Location: Manchester, NH

Re: ".." in Folder List

Post by bhall2001 » Mon Nov 23, 2015 9:45 pm

Ah, thanks for clearing that up. Now it makes sense. I was having a senior moment I guess...

Bob

Post Reply

Return to “Internet”