directory::makeDirectoryPath(Path) & backslash

Discussions related to Visual Prolog
Gildas Menier
VIP Member
Posts: 78
Joined: 8 Jun 2004 23:01

directory::makeDirectoryPath(Path) & backslash

Unread post by Gildas Menier » 15 Apr 2009 14:46

makeDirectoryPath scans the backslashes (according to the source), so

Code: Select all

directory::makeDirectoryPath("c:\\hello\\testdir\\temp")
(which seems ok)

is not the same as :

Code: Select all

directory::makeDirectoryPath("c:/hello/testdir/temp")
(which won't work)

Regards

Gildas

User avatar
Thomas Linder Puls
VIP Member
Posts: 2438
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 15 Apr 2009 19:28

Do you think it is important to support the use of forward slashes? (Why?)
Regards Thomas Linder Puls
PDC

Gildas Menier
VIP Member
Posts: 78
Joined: 8 Jun 2004 23:01

Unread post by Gildas Menier » 15 Apr 2009 19:47

Well, I would find inadequate that some file/directory method should accept both and some not, unless a note is dropped in the documentation (I spent some time to figure out why makeDirectoryFromPath caused some trouble).

Anyway, backslash or not, I don't care as long as the choice is coherent with the methods or documentation

(My post was no protest against or for, only a possible warning ;) )

Best Regards
Gildas

User avatar
Thomas Linder Puls
VIP Member
Posts: 2438
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 16 Apr 2009 8:24

There are only a few places where the PFC code explicitly deals with forward slashes. But the underlying Windows functionality accepts forward slashes in many/most situations.

Determining and describing exactly where forward slashes can be used is most likely a difficult task.

So I guess it is simplest to handle forward slashes everywhere, even though it will make the code less efficient (and even though most use will actually be with back slashes).

I will mark it as a wish.
Regards Thomas Linder Puls
PDC

Post Reply