FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bug with resolving pathes

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Fri Sep 02, 2005 11:31 am    Post subject: bug with resolving pathes Reply with quote

This is on windows xp.
I'm not sure what exactly is the problem, but if I call build and supply it the path of the .d file with slashes this way / (not \) and an object directory, something wrong happens:
--------------------------------------------------
Code:

E:\Temp>dir
 Volume in drive E is Storage
 Volume Serial Number is 405C-4670

 Directory of E:\Temp

09/02/2005  12:33 PM    <DIR>          .
09/02/2005  12:33 PM    <DIR>          ..
09/02/2005  12:33 PM    <DIR>          bin
09/02/2005  12:30 PM                37 test.d
               1 File(s)             37 bytes
               3 Dir(s)   6,084,481,024 bytes free

E:\Temp>build e:/temp/test.d -odbin
Error: bin\/temp/test.def: The system cannot find the path specified.

E:\Temp>dmd e:/temp/test.d -odbin
E:\dmd\dmd\bin\..\..\dm\bin\link.exe bin\test,,,user32+kernel32/noi;

E:\Temp>

--------------------------------------------------

for some reason, build tries to look for bin\/temp/test.def
dmd doesn't seem to have this problem

the problem doesn't occur when I call build this way:
--------------------------------------------------
Code:

E:\Temp>build e:\temp\test.d -odbin
E:\dmd\dmd\bin\..\..\dm\bin\link.exe bin\test,test.exe,,user32+kernel32,bin\test
.def/noi;

E:\Temp>

--------------------------------------------------

In short, if I supply the path like this:
e:/temp/test.d
The bug occurs, but if I supply it like this:
e:\temp\test.d
It works fine.
Note that dmd works find with e:/temp/test.d
Back to top
View user's profile Send private message
AgentOrange



Joined: 21 Jul 2005
Posts: 61

PostPosted: Fri Sep 02, 2005 1:27 pm    Post subject: Reply with quote

try 'build test.d -I..'

its just one of the quirks of build, i still think its nicer than writing a makefile every time
Back to top
View user's profile Send private message
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Fri Sep 02, 2005 1:39 pm    Post subject: Reply with quote

actually I can just
>build test.d

I'm reporting a bug, not complaining about something not working.
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Fri Sep 02, 2005 4:45 pm    Post subject: Reply with quote

hasan wrote:
actually I can just
>build test.d

I'm reporting a bug, not complaining about something not working.

Why is it a bug? The path separator character for Windows is the "\" character. The "/" is the character for Unix. In Windows applications, the "/" is often used as a lead-in character for command line arguments.

For example, open a DOS console window and type in ...
Code:
dir \

You get a listing of the root folder for the current drive. Now try this ...
Code:
dir /

You get an error message "Invalid switch"

A bug is where the program behaviour doesn't conform to the specification. There is no specification that says I need to treat both "/" and "\" as path separators in the Windows environment.

However, as some Windows programs do treat both as valid delimiters, I could enhance Build to do the same. However, I can't treat "\" as a path separator in Unix because that character is a valid file name character in Unix.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Fri Sep 02, 2005 11:52 pm    Post subject: Reply with quote

Well, I haven't read any windows spec (is there one?), but dmd handles it well, so it's natural for one to assume that build does too.

Windows explorer itself handles it.
Infact, if you type "file:///" in windows explorer, the drop down list will contain a list of pahtes that use the / seperator.

I'm not trying to be picky, but maybe some people will try to write tools that use the build tool, and maybe for some reason or another, these tools will supply path names with / seperators on windows machines. (which btw is exactly what happened to me)

Quote:

However, as some Windows programs do treat both as valid delimiters, I could enhance Build to do the same.

Well, there you go.
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Sat Sep 03, 2005 3:51 am    Post subject: Reply with quote

hasan wrote:

Quote:

However, as some Windows programs do treat both as valid delimiters, I could enhance Build to do the same.

Well, there you go.


Your wish is my command, sir.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Sun Sep 04, 2005 9:58 pm    Post subject: Reply with quote

Thank you! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group