1. pathinfo is broken

 trace(1) 
 object info = pathinfo("C:\\euphoria\\docs\\readme.txt") 

[copy-paste from dosbox] 
 info={ 
        {92\,101e,117u,112p,104h,111o,114r,105i,97a,92\,100d,111o,99c,115s}, 
        {114r,101e,97a,100d,109m,101e,46.,116t,120x,116t}, 
        {114r,101e,97a,100d,109m,101e}, 
        {116t,120x,116t}, 
        {67C} 
      } 
 * Press Enter to resume trace 
[/copy-paste from dosbox] 

but according to http://openeuphoria.org/docs/std_filesys.html#_1345_pathinfo:

 -- WINDOWS 
 info = pathinfo("C:\\euphoria\\docs\\readme.txt") 
 -- info is {"C:\\euphoria\\docs", "readme.txt", "readme", "txt", "C"} 
but, it isn't, on winXP, as you can see?

useless

new topic     » topic index » view message » categorize

2. Re: pathinfo is broken

What version of Euphoria are you using?

In latest commit from HG I can read inside filesys.e

-- Returns: 
--              A **sequence**, of length five. Each of these elements is a string: 
--              * The path name. For //Windows// this excludes the drive id. 
--              * The full unqualified file name 
--              * the file name, without extension 
--              * the file extension 
--              * the drive id 
-- 
So I guess the online documentation is not up to date with the code.

However, the example is still wrong:

-- -- WINDOWS 
-- info = pathinfo("C:\\euphoria\\docs\\readme.txt") 
-- -- info is {"C:\\euphoria\\docs", "readme.txt", "readme", "txt", "C"} 

Edit: I've just checked 4.0.5 and the behavior is the same as you describe. It's definitely a bug in the documentation.

new topic     » goto parent     » topic index » view message » categorize

3. Re: pathinfo is broken

gbonvehi said...

What version of Euphoria are you using?

Euphoria Interpreter v4.0.5 development 
   Windows, Using Managed Memory 
   Revision Date: 2013-02-11 02:10:21, Id: 5981:42b209901e89 

gbonvehi said...

Edit: I've just checked 4.0.5 and the behavior is the same as you describe. It's definitely a bug in the documentation.

Instead, can pathinfo[1] be the entire path minus the filename? That's what i was looking for, in all the fury to make Euphoria easier, i still do

object savepath = reverse(cmd) 
savepath = savepath[match("\\",savepath)..$] 
savepath = reverse(savepath) 

Altho i could use rmatch(), i have used the reverse method for 10 years or more. Yeas, there's other ways too.

useless

new topic     » goto parent     » topic index » view message » categorize

4. Re: pathinfo is broken

object savepath = cmd[1..rmatch(sequence "\\", cmd)-2] 
new topic     » goto parent     » topic index » view message » categorize

5. Re: pathinfo is broken

BRyan said...
object savepath = cmd[1..rmatch(sequence "\\", cmd)-2] 

correction

object savepath = cmd[1..rmatch("\\", cmd)-2] 
new topic     » goto parent     » topic index » view message » categorize

6. Re: pathinfo is broken

correction number 2

object savepath = cmd[1..rmatch("\\", cmd)] 
new topic     » goto parent     » topic index » view message » categorize

7. Re: pathinfo is broken

BRyan said...

correction number 2

object savepath = cmd[1..rmatch("\\", cmd)] 



That's why i still do it the way i do it. smile

useless

new topic     » goto parent     » topic index » view message » categorize

8. Re: pathinfo is broken

useless_ said...

Instead, can pathinfo[1] be the entire path minus the filename? That's what i was looking for, in all the fury to make Euphoria easier, i still do

object savepath = reverse(cmd) 
savepath = savepath[match("\\",savepath)..$] 
savepath = reverse(savepath) 

Altho i could use rmatch(), i have used the reverse method for 10 years or more. Yeas, there's other ways too.

Have you tried pathname?

Matt

new topic     » goto parent     » topic index » view message » categorize

9. Re: pathinfo is broken

mattlewis said...
useless_ said...

Instead, can pathinfo[1] be the entire path minus the filename? That's what i was looking for, in all the fury to make Euphoria easier, i still do

object savepath = reverse(cmd) 
savepath = savepath[match("\\",savepath)..$] 
savepath = reverse(savepath) 

Altho i could use rmatch(), i have used the reverse method for 10 years or more. Yeas, there's other ways too.

Have you tried pathname?

Matt

Never heard of it. You are saying pathname isn't in pathinfo? Ironic. Did you know the "See also:" under http://openeuphoria.org/docs/std_filesys.html#_1345_pathinfo doesn't list pathname? Neither does http://openeuphoria.org/docs/std_filesys.html#_1354_dirname . In fact, it looks now like pathname() is an alias for dirname()?

I hit another similar situation an hour or so later, and shelved the whole project. I didn't start it to discover issues, or learn the OS, or learn the new keywords.

useless

new topic     » goto parent     » topic index » view message » categorize

10. Re: pathinfo is broken

eukat said...
mattlewis said...
eukat said...

Instead, can pathinfo[1] be the entire path minus the filename? That's what i was looking for, in all the fury to make Euphoria easier, i still do

object savepath = reverse(cmd) 
savepath = savepath[match("\\",savepath)..$] 
savepath = reverse(savepath) 

Altho i could use rmatch(), i have used the reverse method for 10 years or more. Yeas, there's other ways too.

Have you tried pathname?

Matt

Never heard of it. You are saying pathname isn't in pathinfo? Ironic.

It is in there, but the drive letter is listed separately. (That should still work as an "absolute" path if the current drive is the same one that that path is from.) Docs are buggy, though.

eukat said...

More buggy docs. :(

eukat said...

In fact, it looks now like pathname() is an alias for dirname()?

Another bug in the docs. They should be distinguished. The subtle (and undocumented?) difference: pathname() includes the drive letter and colon, but dirname() omits it altogether. Instead, dirname() returns the same kind of stripped path that pathinfo() itself returns.

Someone really needs to file tickets for all of these documentation issues.

eukat said...

I didn't start it to discover issues, or learn the OS, or learn the new keywords.

Understandable.

eukat said...

I hit another similar situation an hour or so later, and shelved the whole project.

Well, I'm suprised that you didn't come up with your own "dos-hacky" way to do it - or at least some 3.11 code to do the job.

new topic     » goto parent     » topic index » view message » categorize

11. Re: pathinfo is broken

useless_ said...
jimcbrown said...

Someone really needs to file tickets for all of these documentation issues.

Sure, yeas, that's what will take care of it, more tickets. I'd file tickets, but i don't feel like fighting over them. I'd attempt fixing the docs, but you have your set ways for generating them that i am not allowed to be part of. I'd fix the search system, but last time i coded a search system for every word in the RDS archives, i got zero pats on the back for it. So, my takeaway is that you don't want me to do anything usefull. It's working for you so far.

ZOMG! Zero pats on the back! I don't recall this incident, but helpful help from any source is appreciated by me (and others). You used to have commit permissions, but withdrew for various reasons. I know you think there is a grand conspiracy to keep you out, but there really isn't.

Matt

new topic     » goto parent     » topic index » view message » categorize

12. Re: pathinfo is broken

mattlewis said...

helpful help from any source is appreciated by me (and others).

Agreed. I'd go one step further and say that just the act of reporting all of these issues on the forum is still a big help and useful contribution (as it increases the likelyhood that someone will fix them or at least create a ticket for it).

new topic     » goto parent     » topic index » view message » categorize

13. Re: pathinfo is broken

jimcbrown said...
mattlewis said...

helpful help from any source is appreciated by me (and others).

Agreed. I'd go one step further and say that just the act of reporting all of these issues on the forum is still a big help and useful contribution (as it increases the likelyhood that someone will fix them or at least create a ticket for it).

And yet you have such an itchy trigger finger for deleting my posts. What is it now, every other post you automatically delete? I have no faith that anything i do to help Matt or Derek would go unpunished by you.

useless

new topic     » goto parent     » topic index » view message » categorize

14. Re: pathinfo is broken

eukat said...
jimcbrown said...
mattlewis said...

helpful help from any source is appreciated by me (and others).

Agreed. I'd go one step further and say that just the act of reporting all of these issues on the forum is still a big help and useful contribution (as it increases the likelyhood that someone will fix them or at least create a ticket for it).

And yet you have such an itchy trigger finger for deleting my posts. What is it now, every other post you automatically delete? I have no faith that anything i do to help Matt or Derek would go unpunished by you.

Well, I haven't deleted any posts at all this week, so I think it's off to a good start. tongue

new topic     » goto parent     » topic index » view message » categorize

15. Re: pathinfo is broken

jimcbrown said...
eukat said...
jimcbrown said...
mattlewis said...

helpful help from any source is appreciated by me (and others).

Agreed. I'd go one step further and say that just the act of reporting all of these issues on the forum is still a big help and useful contribution (as it increases the likelyhood that someone will fix them or at least create a ticket for it).

And yet you have such an itchy trigger finger for deleting my posts. What is it now, every other post you automatically delete? I have no faith that anything i do to help Matt or Derek would go unpunished by you.

Well, I haven't deleted any posts at all this week, so I think it's off to a good start. tongue

Someone did:

http://openeuphoria.org/forum/121486.wc#121486

And yeas, i think it's very relavant to the topic: you said help is welcome, Matt said help is welcome, but my posts get deleted, ergo i am not welcome.

useless

new topic     » goto parent     » topic index » view message » categorize

16. Re: pathinfo is broken

eukat said...

Someone did:

http://openeuphoria.org/forum/121486.wc#121486

And yeas, i think it's very relavant to the topic: you said help is welcome, Matt said help is welcome, but my posts get deleted, ergo i am not welcome.

I guess I could argue on a technicality that the post (as reproduced in Matt's quote, if that's the whole thing) and all its child posts are diverging from the original topic of pathinfo in this thread. I'd have to ask the person who actually deleted it for his or her reasoning, though.

Also, I'd draw a significant distinction between a single post (or group of related posts) and the entire person. To use an analogy, a brilliant and kind person may have a bad day and end up writing an angry email that they later end up regretting - but this is by no means typical of that person in general. OTOH, as Matt often points out, trolls (like EUWX) can often be accidently helpful too.

new topic     » goto parent     » topic index » view message » categorize

17. Re: pathinfo is broken

jimcbrown said...

I'd have to ask the person who actually deleted it for his or her reasoning, though.

I try to avoid kat's crap as much as possible, and have held myself back for a very long time, but to hear her whine about this grand conspiracy against her sometimes gets to be too much. Straw on the camel's back, etc...

So, deleted post for: Irrelevant whining, persecution complex, etc...

new topic     » goto parent     » topic index » view message » categorize

18. Re: pathinfo is broken

euphoric said...
jimcbrown said...

I'd have to ask the person who actually deleted it for his or her reasoning, though.

I try to avoid kat's crap as much as possible, and have held myself back for a very long time, but to hear her whine about this grand conspiracy against her sometimes gets to be too much. Straw on the camel's back, etc...

So, deleted post for: Irrelevant whining, persecution complex, etc...

Gosh, it's hard to see how throwing words at me like those would cause anyone to think you are anything but the nicest of humans, CK.

useless

new topic     » goto parent     » topic index » view message » categorize

19. Re: forum moderation is broken

Seriously? It looks like the moderation is broken. Someone is being WAY overzealous here.

new topic     » goto parent     » topic index » view message » categorize

20. Re: forum moderation is broken

jaygade said...

Seriously? It looks like the moderation is broken. Someone is being WAY overzealous here.

Someone is apparently spamming the forum.

new topic     » goto parent     » topic index » view message » categorize

21. Re: forum moderation is broken

euphoric said...
jaygade said...

Seriously? It looks like the moderation is broken. Someone is being WAY overzealous here.

Someone is apparently spamming the forum.

Or maybe they were just trying to get ONE post thru?

useless

new topic     » goto parent     » topic index » view message » categorize

22. Re: forum moderation is broken

useless_ said...
euphoric said...
jaygade said...

Seriously? It looks like the moderation is broken. Someone is being WAY overzealous here.

Someone is apparently spamming the forum.

Or maybe they were just trying to get ONE post thru?

useless

Yes, my point was that someone was deleting too many posts. They need to stop, or someone needs to stop them from doing so. I don't know if this forum keeps logs, but I think that someone with moderator privileges is abusing his or her power.

I don't always agree with what you say, useless, but I agree with your right to say it in this forum and that it's not "spamming". You have proven yourself over and over again to be a useful contributor to this community.

I don't know who is doing it, but I see a lot of your posts deleted before I get a chance to read them and judge them on their own merits.
Forked into: Overzealous forum moderation

new topic     » goto parent     » topic index » view message » categorize

23. Re: forum moderation is broken

useless_ said...
euphoric said...
jaygade said...

Seriously? It looks like the moderation is broken. Someone is being WAY overzealous here.

Someone is apparently spamming the forum.

Or maybe they were just trying to get ONE post thru?

useless

My understanding is you were posting the exact same thing every time, and each time it was deleted because it was useless or inappropriate or otherwise off-topic.

In that circumstance, it's a valid deletion.

new topic     » goto parent     » topic index » view message » categorize

24. Re: forum moderation is broken

euphoric said...
useless_ said...
euphoric said...
jaygade said...

Seriously? It looks like the moderation is broken. Someone is being WAY overzealous here.

Someone is apparently spamming the forum.

Or maybe they were just trying to get ONE post thru?

useless

My understanding is you were posting the exact same thing every time, and each time it was deleted because it was useless or inappropriate or otherwise off-topic.

In that circumstance, it's a valid deletion.

As was your post, which i was responding to, which wasn't deleted, and should be.

useless

new topic     » goto parent     » topic index » view message » categorize

25. Re: forum moderation is broken

useless_ said...

As was your post, which i was responding to, which wasn't deleted, and should be.

Actually, I was explaining why I deleted your inanity. That is an acceptable post from an admin regarding his actions taken on another post (especially as I was responding to another admin's question).

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu