Author Topic: How do I get recursively adding files to work?  (Read 9526 times)

Offline tzonkov

  • Single posting newcomer
  • *
  • Posts: 7
How do I get recursively adding files to work?
« on: August 11, 2006, 11:48:50 pm »
I am brand spanking new to C::B so take it easy.

I just installed (from binaries) the Nightly Build (Aug 11) on my XP Pro system. I don't have any of teh standard compilers installed on this system. I went and created a new empty project using the wizard but I am stuck adding files to it. I am trying to do it recursively since there are many files in many directories. The problem I see id the following:

After I select the directory to add recursively from C::B gives me a dialog box "Multiple Selection" which is empty. I assume I should see a list of all the files under the directory I selected.

Am I missing something? I hope there is a solution to this, from the site this looks like a realy decent and fast IDE.

[edit] I have also tried a couple of older nightly builds as well as RC2. All seem to run into the same problem. I am assuming it's a problem with my XP "configuration" since nobody else is complaining. I am open to ideas. Is there some XP service that needs to be running for this to work?[/edit]

Alex
« Last Edit: August 12, 2006, 12:54:24 am by tzonkov »

Offline tzonkov

  • Single posting newcomer
  • *
  • Posts: 7
Re: How do I get recursively adding files to work?
« Reply #1 on: August 12, 2006, 07:28:46 pm »
OK. I tried it on another XP machine, and it works just fine.

Anyone out there know which XP services needs to be running for the recursive file add to work?

Thanks

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2262
Re: How do I get recursively adding files to work?
« Reply #2 on: August 12, 2006, 07:54:47 pm »
OK. I tried it on another XP machine, and it works just fine.

Anyone out there know which XP services needs to be running for the recursive file add to work?

Thanks

Isn't that a msvcrt.dll function to enumerate the files in a directory. I.e., findfirst, findnext functions?

Check that dll. Has another dll replaced it? Has a policy been set that disallows directory or file enumeration? Is the directory or files marked hidden. Are .cpp .h files  owned by another process? Are they hidden by a policy?

Do any other programs on your system have the problem?

Just guessing....


« Last Edit: August 12, 2006, 07:56:36 pm by Pecan »

Offline tzonkov

  • Single posting newcomer
  • *
  • Posts: 7
Re: How do I get recursively adding files to work?
« Reply #3 on: August 15, 2006, 04:08:32 am »
Ok I went and got a fresh build from our IT department today to see if it fixes this problem.  Basically it's the closes thing to re-installing windows for me since this is a work laptop.

I still do not see the file list get populated. I checked msvcrt.dll and it is on this system. I have not seen similar problems with any other applications. This is getting to be very frustrating.

Any other ideas?

Thanks.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2262
Re: How do I get recursively adding files to work?
« Reply #4 on: August 15, 2006, 04:40:54 am »
I still do not see the file list get populated.
Any other ideas?

Have you tried clicking on "Wildcard Select" in the Multiple Select dialoge to see if the file type is set correctly?



Offline tzonkov

  • Single posting newcomer
  • *
  • Posts: 7
Re: How do I get recursively adding files to work?
« Reply #5 on: August 15, 2006, 05:17:29 am »
There is nothing selected in "Wildcard Select".

I don't see any files listed when I first select the directory. I have verified that this works on other XP installations. But I need to make it work on this one, since this is my main development system.

Thanks for the ideas, any more? I am hoping the person who wrote this feature might be able to help...

Alex

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: How do I get recursively adding files to work?
« Reply #6 on: August 15, 2006, 07:56:25 am »
The only thing that alters the actual files list, is this piece of code:

Code: C++
  1.     while (i < array.GetCount())
  2.     {
  3.         // discard directories, as well as some well known SCMs control folders ;)
  4.         // also discard C::B project files
  5.         if (wxDirExists(array[i]) ||
  6.             array[i].Contains(_T("\\.svn\\")) ||
  7.             array[i].Contains(_T("/.svn/")) ||
  8.             array[i].Contains(_T("\\CVS\\")) ||
  9.             array[i].Contains(_T("/CVS/")) ||
  10.             array[i].Lower().Matches(_T("*.cbp")))
  11.         {
  12.             array.RemoveAt(i);
  13.         }
  14.         else
  15.             ++i;
  16.  

As you can see, some items are discarded from the list. C::B project files, directories and files that reside under paths like /CVS/ or /.svn/.

Is your directory structure something like this?
Be patient!
This bug will be fixed soon...

Offline tzonkov

  • Single posting newcomer
  • *
  • Posts: 7
Re: How do I get recursively adding files to work?
« Reply #7 on: August 15, 2006, 08:54:38 am »
Yes my directory structure is all under c:\CVS

That explains the blank file list dialog... what are my options?

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How do I get recursively adding files to work?
« Reply #8 on: August 15, 2006, 09:11:57 am »
Yes my directory structure is all under c:\CVS

That explains the blank file list dialog... what are my options?
C:\cvs (lowercase) or c:\CBS ? :P

EDIT: I think this shall not be hard-coded.
« Last Edit: August 15, 2006, 09:53:30 am by Takeshi Miya »

Offline tzonkov

  • Single posting newcomer
  • *
  • Posts: 7
Re: How do I get recursively adding files to work?
« Reply #9 on: August 15, 2006, 09:31:31 am »
I figured I can change the directory name and get it to work. I guess I can add a request to remove that harcoded filter. Since there is the wildcard filter, the hardcoded list of ommissions should not be needed any longer. Amy I correct in assuming this?

By the way thanks for the clarification and solution....

Alex

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: How do I get recursively adding files to work?
« Reply #10 on: August 15, 2006, 09:54:32 am »
I figured I can change the directory name and get it to work. I guess I can add a request to remove that harcoded filter. Since there is the wildcard filter, the hardcoded list of ommissions should not be needed any longer. Amy I correct in assuming this?

No. Using a directory named "CVS" is bad practice. You should avoid that at all costs. It can make cvs (the program) behave badly. If you still want to use it, rename it to something else like "CVS_files", for example...
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: How do I get recursively adding files to work?
« Reply #11 on: August 15, 2006, 09:59:11 am »
Quote from: Takeshi Miya link=topic=3817.msg30193#msg30193
EDIT: I think this shall not be hard-coded.

This will always be hardcoded, Takeshi.
These are well known directories used by well-known SCMs (at least in the open source world). If you want, disable this filtering code and try adding multiple files from a directory which is under revision control by either svn or cvs (especially the last). You 'll be thankful C::B hides it from you all this time...

What should be added though, is a warning text in the multiple select dialog stating the fact that some files were ignored for that reason.
Be patient!
This bug will be fixed soon...

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How do I get recursively adding files to work?
« Reply #12 on: August 15, 2006, 10:03:48 am »
Quote from: Takeshi Miya link=topic=3817.msg30193#msg30193
EDIT: I think this shall not be hard-coded.

This will always be hardcoded, Takeshi.
These are well known directories used by well-known SCMs (at least in the open source world). If you want, disable this filtering code and try adding multiple files from a directory which is under revision control by either svn or cvs (especially the last). You 'll be thankful C::B hides it from you all this time...
I was thinking in another (way more) possibilities for not necessaringly hardcoding them, such as ".bazaar", ".anyothercontrolsystem", "_svn", ".obj", and well, you can imagine a lot more.

What should be added though, is a warning text in the multiple select dialog stating the fact that some files were ignored for that reason.
They would continue to be hard-coded, but at least it would be transparent for the user.

In general I don't consider good (but handy when time is scarce, altrough it doesn't pays in the end) hard-coding these kind of values (paths, filenames, wildcards, etc) as they change a lot in a lot of different systems.


EDIT: The point was, that with not hardcoding them, we eliminate all future possible requests for "hey please add support for x path which I use often and would like to see hidden as .svn" and "hey please remove support for CVS since in my scripts relies on it".
Well everything's fine when one can change them at runtime, but when it requieres recompilation it can become a pain, since you don't have always the code at hand.

« Last Edit: August 15, 2006, 10:17:57 am by Takeshi Miya »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: How do I get recursively adding files to work?
« Reply #13 on: August 15, 2006, 10:44:33 am »
Quote
The point was, that with not hardcoding them, we eliminate all future possible requests for "hey please add support for x path which I use often and would like to see hidden as .svn" and "hey please remove support for CVS since in my scripts relies on it".

I think you 're missing the point here.
We do filter these specific values because they are very well-known. There was never the intention to make this configurable.

Maybe you want to make the C::B project/workspace extensions configurable too?
Be patient!
This bug will be fixed soon...

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How do I get recursively adding files to work?
« Reply #14 on: August 15, 2006, 10:57:06 am »
Maybe you want to make the C::B project/workspace extensions configurable too?
Well, not configurable, but in the snippet above I can't see for example ".workspace" being filtered out (that was the point).

OT: I think I can see why the extension ".workspace" is not included, it's well-known, but it's also very common (every program seems to want it associated) so it was safer not to include.

In the snippet I'm missing also the constant for the project files (and workspaces, .layouts, and so on), and some kind of moduladirity (for reusability) like GetProjectExtensions() (including .dsw, .dsp, ...) and GetSCMCommonPaths().

But, that moduladirity is not really needed (here, in this case) if they can be either configurable, or scriptable.
« Last Edit: August 15, 2006, 11:26:21 am by Takeshi Miya »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: How do I get recursively adding files to work?
« Reply #15 on: August 15, 2006, 11:26:42 am »
In general I don't consider good (but handy when time is scarce, altrough it doesn't pays in the end) hard-coding these kind of values (paths, filenames, wildcards, etc) as they change a lot in a lot of different systems.
Yes, but we know that you want everything configurable and changeable, even if it makes no sense at all. This is another good example of why you get to hear "No, Takeshi" so often (apart from the fact that we have paid very dearly every time we followed one of your requests or ideas).
Why can't you just for once accept it if you are told that something is intentional and that something is like this because of some reason?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: How do I get recursively adding files to work?
« Reply #16 on: August 15, 2006, 12:13:13 pm »
Why can't you just for once accept it if you are told that something is intentional and that something is like this because of some reason?
I can accept it (and I'm doing it) because I think this is only a thing like what's two lines below
Code: [Select]
// ask the user which files to add
// TODO (mandrav#1#): Make these masks configurable

Yes, but we know that you want everything configurable and changeable, even if it makes no sense at all.
Yes, in reality the point we don't agree is not the "configurable and changeable", but the part about "if it makes sense".
What makes sense for ones doesn't for others (ask Alex, which lost perhaps some time finding the issue, and if Yiannis wouldn't told that, he may would never know). I don't think everything in the IDE has to fit everybody, that's why it's modular, but for the SDK part, yes, IMHO it should have the less things possible hard-coded (and for file extensions/paths, there exist some enums for them).

You are right, that in this case (we're talking about a very little feature "called usability by the comments"), it does not make a lot of sense to touch anything further, because it involves time (which is scarse), but not because it is inherently bad to touch it.
(I see this as an another TODO like the one two lines below).


Remember "_svn" in autorevision? Well, it's missing here too. (It's about moduladirity)
The only difference is that here this a little feature, not something crucial (like autorevision), so not much people would mind.


But, and as a whole, I don't really care for this (if I talk for myself, because if I would be Alex the situation would change), I'm only trying to remember that there exist code in the SDK which needs
1) Resolve some TODOs like "Make these masks configurable"
but (most importantly):
2) Add some TODOs to the code, which are hard to see (this case), and may need some discussion before implementing it.


This is of what I'm convinced, but I don't want to make loose more time for any of you on this (since I'm more worried about the big picture rather than a little issue which is a feature and not a bug anyways).
Since obviously anybody can't provide patches if there's no agreement for this (neither change the functionality trough a plugin), we should move on and end this topic.

Note that I'm not angry at all and I understand all choices being made, but I just see that there's too much things left to modularize in the SDK (and the compiler plugin and codecompletion...) so I'm looking after a positive response (either "fixed in svn", or "marked as a todo" or "yes, that's right, you can provide a patch for this").

Particularly I'm more concerned regarding modularity and generalization for languages other than C/C++ in the SDK (not plugins yet).

« Last Edit: August 15, 2006, 12:16:43 pm by Takeshi Miya »

Offline kidmosey

  • Multiple posting newcomer
  • *
  • Posts: 95
    • MUSITU International
Re: How do I get recursively adding files to work?
« Reply #17 on: August 17, 2006, 07:33:25 am »
I haven't checked, but would it be too difficult to implement keeping the SCM files in the list and just unselecting them, or even putting a small checkbox in the multiple selection dialog to "show hidden files" to let you see what was deleted?

This at least makes it clear to the user that there are some files that are being left out of the search (I assumed all files were included).
3 years until google knows more than god.

Offline tzonkov

  • Single posting newcomer
  • *
  • Posts: 7
Re: How do I get recursively adding files to work?
« Reply #18 on: August 21, 2006, 05:45:29 pm »
I agree that some kind of warning or indication that a ton of files were excluded because they were all under a well known SVN/CVS directory would help new users in the future. I did spend quite a bit of time trying to figure this out, and I was close to dropping this IDE because this is a feature which was importnat to me.

With all that said, I understand this is an open source project and development time is a commodity. I am just glad that people who are intimate with the code read the help section of the forums. Also since this thread is now part of the forums, I hope future new users who might hit the same issue will be able to find a resolution quickly by searching the forums.

Thanks again for the help.