Re: Real world example of the includes-with-the-same-name "bug"

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jason Gade wrote:
> 
> Vincent wrote:
> > 
> > Jason Gade wrote:
> > 
> > > I'm not sure what you mean here. Relative and absolute paths already work
> > > properly.
> > > They use the OS file routines which resolve this automatically, I believe.
> > 
> > Correct, but I have to convert the "new_include_name" strings into a full
> > paths
> > otherwise they wont compare correctly.
> 
> <snip> 
> 
> I see a little better where you are going with this and some of the
> possibilities
> for error. I think I would handle it differently though. Two different
> solutions:
> 
> 1. Surely the OS and/or the C library for Watcom has a function that returns
> the full path of a file given the relative path. No need for the program to
> parse. Just compare.
> 
> -or-
> 
> 2. In cases where the filename is the same, compare file sizes. If they are
> the same then issue a warning or error saying the user is probably trying to
> include the exact same file twice.
> 
> Of course, barring using someone's library, if I tried to specify the same
> file
> path by using two different strings I should be slapped. blink
> 
> > Regards,
> > Vincent

Another thing is that in Linux you can have soft links, which are like an alias
for a file. So you could do the following and still end up (accidentally)
including the same file twice:

include foo/bar -- original file
include baz/moo -- softlink to foo/bar

Hmmm. I wonder if this works in Euphoria for Linux right now...

Again, I think Linux has OS functions for resolving this.

--
"The author regrets that he is unable to reconcile himself to the
thoughtful point of view you have expressed. However, it must be kept
in mind that being raised in different cultures and different places can
result in such differences of viewpoint between individuals.
The author is from planet Earth." [author unknown]

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu