none
Error with exception RRS feed

  • Question

  • Hi,
    Any idea to this error?


    Exception/StackTrace - The device is not ready.
        at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileSystemEnumerableIterator`1.CommonInit()
       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
       at System.IO.Directory.GetFiles(String path)
       at ScanFolder.Program.DirSearch(String directoryPath, String par_OutFile)   
    



    Many Thanks & Best Regards, Hua Min

    Sunday, September 1, 2019 10:00 AM

Answers

  • Kind of a guessing game without seeing your code and what device you are working with. So a guess is a) as indicated some device is not ready b) lack of permissions to read said device.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by Jackson_1990 Monday, September 2, 2019 3:17 AM
    Sunday, September 1, 2019 11:11 AM
    Moderator

All replies

  • Kind of a guessing game without seeing your code and what device you are working with. So a guess is a) as indicated some device is not ready b) lack of permissions to read said device.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by Jackson_1990 Monday, September 2, 2019 3:17 AM
    Sunday, September 1, 2019 11:11 AM
    Moderator
  • Hi,

    The account (running the code) is having no change in privileges and is still able to remove or add file into relevant path. It is strange to have this error.

    Previously everything was fine and I did no change at all. Here are the codes:

            static void Main(string[] args)
            {
                string File1,OrigPath;
                File1 = "C:/ed/List0.txt";
                //OrigPath = "y:/BizIn/error/";
                OrigPath = "y:/BizIn/error/";
    
                DirSearch(OrigPath, File1);
    
            }


    Many Thanks & Best Regards, Hua Min


    Sunday, September 1, 2019 11:28 AM
  • as you don't post the code for "DirSearch", we can't know what is passed to Directory.GetFiles.

    "still able to remove or add file into relevant path" - in explorer?
    The program is running under the same account?
    Sunday, September 1, 2019 12:18 PM