#66 Absolute path on Windows

Windows (1)

I'm using MAGMI on windows and could never get absolute file references (of the type "C:\path") to work. I used relative paths but it was a bit of a pain negotiating the windows file system.

I could see that a unix type path starting with / would work so I finally decided to see what I was doing wrong with my absolute path specification.

In the end, I tracked it down to what I think is a bug in:

function isabspath($path)
return ($path[0]=="." || (substr(PHP_OS,3)=="WIN" && strlen($path)>1)?$path[1]==":":$path[0]=="/");

PHP_OS is "WINNT" and the highlighted code returns "NT"!

I think the highlighted part should be changed to:

function isabspath($path)
return ($path[0]=="." || (substr(PHP_OS,0,3)=="WIN" && strlen($path)>1)?$path[1]==":":$path[0]=="/");


  • brainski

    brainski - 2013-09-20

    I can confirm this bug and I also can confirm that the provided changed fixes the problem!
    Thanks and please commit this change to live version

  • PedroKTFC

    PedroKTFC - 2014-01-31

    This is a change to inc/magmi_utils.php. I'd be happy to make the change but I've no idea how to edit files in the git repository. Can somebody point me to some simple (!) instructions please?

  • Sebastien Bracquemont

    in fact, this should have been already fixed in latest git. commit #e71cf1

    Last edit: Sebastien Bracquemont 2014-04-14
  • Sebastien Bracquemont

    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks