Author Topic: Why is vl-directory-files crashing the strcat?  (Read 3018 times)

0 Members and 1 Guest are viewing this topic.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Why is vl-directory-files crashing the strcat?
« on: April 25, 2011, 09:39:44 PM »
Why is results from vl-directory-files crashing the (strcat UserPath2 "\\" DCTCUST-list)

Code: [Select]
(setq DCTCUST-list (vl-directory-files UserPath2  "*.cus" 1))
(vl-file-rename (strcat UserPath2 "\\" DCTCUST-list) DictFilePath)

Quote
Command: TEST
; error: bad argument type: stringp ("TED KRUSH SpellDict - Copy.cus")
; reset after error
Command:

I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Why is vl-directory-files crashing the strcat?
« Reply #1 on: April 25, 2011, 11:20:49 PM »
vl-directory-files returns a list of files within the specified directory, not a string.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Why is vl-directory-files crashing the strcat?
« Reply #2 on: April 26, 2011, 09:48:47 AM »
So I need to convert it to a string. *sigh*

Thanks.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Why is vl-directory-files crashing the strcat?
« Reply #3 on: April 26, 2011, 09:51:37 AM »
So I need to convert it to a string. *sigh*

Thanks.
No, it will return a list of strings. It could return a list with 1 item or 100 items.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Why is vl-directory-files crashing the strcat?
« Reply #4 on: April 26, 2011, 09:52:07 AM »
Consider 'car' perhaps, or 'mapcar' to process the whole list.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Why is vl-directory-files crashing the strcat?
« Reply #5 on: April 26, 2011, 09:59:49 AM »
So I need to convert it to a string. *sigh*

Thanks.
No, it will return a list of strings. It could return a list with 1 item or 100 items.

That is is just it.  There should be just one item being returned.  But I suppose I should throw in some error trap if there happens to be more than one item.  I will make a note to do that in the second wave.  Right now it is just to get it working.

Consider 'car' perhaps, or 'mapcar' to process the whole list.
Will do.  Thanks.  And IIRC you did a tutorial on working with list.  I will go check that out. 

Thanks again Guys.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Why is vl-directory-files crashing the strcat?
« Reply #6 on: April 26, 2011, 10:01:05 AM »
There you go, listen to Lee; he likes to talk more than I do. :-D
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Why is vl-directory-files crashing the strcat?
« Reply #7 on: April 26, 2011, 11:20:49 AM »
There you go, listen to Lee; he likes to talk more than I do. :-D
Hey? What?  I thought I was listening you too.  Sooooorrrrrrreeeeeee!  :-P :-)

I got it working with car function.  It took me a little bit of trial and error.  I can not say that Autodesk help files are of much help on this subject.  But then I realize that vl-directory-files is the right function.  :oops:  I think vl-file-copy might be better suited when it comes to my users.  I am not sure, I will have to look into it some more.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Why is vl-directory-files crashing the strcat?
« Reply #8 on: April 26, 2011, 11:22:40 AM »
There you go, listen to Lee; he likes to talk more than I do. :-D
Hey? What?  I thought I was listening you too.  Sooooorrrrrrreeeeeee!  :-P :-)

I got it working with car function.  It took me a little bit of trial and error.  I can not say that Autodesk help files are of much help on this subject.  But then I realize that vl-directory-files is the right function.  :oops:  I think vl-file-copy might be better suited when it comes to my users.  I am not sure, I will have to look into it some more.
You were/are. I wasn't pissed, I was mostly laughing at my ambiguity.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox