Euphoria Ticket #516: Create a join_paths() function

join_paths({ "people", "john", "/doe.txt" }) 
-- windows: "people\\john\\doe.txt" 
-- *nix: "people/john/doe.txt" 

i.e. handles if slash is present or not, can join any number of path items.

Details

Type: Feature Request Severity: Normal Category: Library Routine
Assigned To: jeremy Status: Fixed Reported Release: 4628
Fixed in SVN #: View VCS: none Milestone: 4.0.1

1. Comment by ne1uno Dec 08, 2010

need an override slash param for forcing slash instead of backslash on windows or vice versa

2. Comment by jeremy Jan 01, 2011

accepted ticket

3. Comment by jeremy Jan 01, 2011

See: hg:euphoria/rev/e724410c67ea

changeset: 4457:e724410c67ea branch: 4.0 tag: tip user: Jeremy Cowgar <jeremy@cowgar.com> date: Sat Jan 01 10:06:03 2011 -0500 files: docs/release/4.0.1.txt include/std/filesys.e tests/t_filesys.e description: Added join_path and split_path methods, fixes ticket 516

4. Comment by jeremy Jan 01, 2011

In regards to an override, I think it would be better if we had a convert_path type function that would convert a path to a given format. The reason I think this is:

  1. It will only be used in specialized situations
  2. Many other routines that do path manipulation do not provide slash override functionality
  3. A generic convert_path routine would allow any path to be converted back and forth providing functionality for any path you may be working with.

Search



Quick Links

User menu

Not signed in.

Misc Menu