### Autor Tema: behaviour of fileinfo windows v.s. linux  (Leído 1153 veces)

#### handsource-dyko

• Hero Member
• Mensajes: 568
• Karma: 32
• I'm the eye in the sky.
##### behaviour of fileinfo windows v.s. linux
« en: Enero 30, 2011, 02:11:13 pm »
I've noticed that under windows, a "\" is added at the end of the path. So when I add the fileinfo.path and fileinfo.name strings together I get "C:\bennu\test\test1.prg".
under linux this would result int to "/home/pieter/bennu/testtest1.prg", so I need to add a "/", obviously it should be "/home/pieter/bennu/test/test1.prg"

Because fileinfo.path under windows is  "C:\bennu\test\" and under linux it is "/home/pieter/bennu/test" Why does this behave differently? I've found out after a lot of
frustation with my latest creation, a bennu based file selection dialog box.

Is it just a platform specific thing? There is nothing about this different behaviour on the wiki.

Also, how is the behaviour under other operation systems like macos/haiku os/gpwiz/caanoo? I suspect a linux like behaviour, thinking
windows is different from the rest.
« última modificación: Enero 30, 2011, 02:36:43 pm por handsource-dyko »

#### FreeYourMind

• Hero Member
• Mensajes: 5674
• Karma: 127
##### Re: behaviour of fileinfo windows v.s. linux
« Respuesta #1 en: Enero 30, 2011, 04:11:39 pm »
You never must use '\' in a path, this is compatible only with windows. Use always '/' and you don't have problems in any SO.

#### handsource-dyko

• Hero Member
• Mensajes: 568
• Karma: 32
• I'm the eye in the sky.
##### Re: behaviour of fileinfo windows v.s. linux
« Respuesta #2 en: Enero 30, 2011, 08:01:49 pm »
I suppose that "/" is the posix compatibe way? Anyway, it works now. Another windows oddity though, are drive letters. On linux or unix style os's this handled in a much more elegant way, namely that drives are mounted in the main tree. Only for windows I have to add extra code for drive selection, even though under the hood, modern windows versions also seem to use this sceme, but still maintain the antiquated drive letter concept! (At least for users, windows xp is supposed to be posix compatibe).