Results 1 to 5 of 5

Thread: big in GetFiles()

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    45

    big in GetFiles()

    Sorry, i meant "bug" in GetFiles()..but you probably know that



    I wish to pull "*.dft"


    Unfortunately, there seems to be a bug which causes this to actually be "*.dft*".

    I can't have it pull "*.dft*" because i have .dft files as well as .dft_backup files which are automatically generated. This is extremely inconvenient.

    It's inconvenient because i call Array.Sort after getting the files..and it throws an exception saying it cannot compare the .dft file with the .dft_backup file. (If this did not cause an exception, my code would end up just deleting the .dft_backup file, which would be ok with me.)


    Here is the basic snippet:

    Code:
    DirectoryInfo loadDirPath = new DirectoryInfo(this.basePath + "\\" + monthYearDir + "\\" + dayDir + "\\" + loadDir);
    
    FileInfo[] allDFTFilesInLoadDir = loadDirPath.GetFiles("*.dft");
    string[] test = Directory.GetFiles(loadDirPath.ToString(), "*.dft");
    Both of them show 2 files when there is really only one .dft file.



    Anyone know how I could get around this?...without having to split on '.' and counting the characters of element[1]. Thanks
    Last edited by icawn; Jun 24th, 2009 at 01:32 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width