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

tzonkov

  • Guest
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 »

tzonkov

  • Guest
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: 2750
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 »

tzonkov

  • Guest
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: 2750
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?



tzonkov

  • Guest
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: 4315
    • 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: cpp
    while (i < array.GetCount())
    {
        // discard directories, as well as some well known SCMs control folders ;)
        // also discard C::B project files
        if (wxDirExists(array[i]) ||
            array[i].Contains(_T("\\.svn\\")) ||
            array[i].Contains(_T("/.svn/")) ||
            array[i].Contains(_T("\\CVS\\")) ||
            array[i].Contains(_T("/CVS/")) ||
            array[i].Lower().Matches(_T("*.cbp")))
        {
            array.RemoveAt(i);
        }
        else
            ++i;

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...

tzonkov

  • Guest
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?

takeshimiya

  • Guest
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 »

tzonkov

  • Guest
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: 4315
    • 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: 4315
    • 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...

takeshimiya

  • Guest
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: 4315
    • 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...

takeshimiya

  • Guest
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 »