none
Getting delay when calculating size of Operating system temporary file run time in Windows 10 English Operating system ?? RRS feed

  • Question

  • Hi 

    I am developing a tool that involves size calculation of temporary file at run time. so I used following code to calculate size of OS temporary file.

    filePath = Path.GetTempFileName();

    while(true){

    .......

    UInt64 fileSize = (UInt64)(new FileInfo(filePath)).Length;

    .......

    }

    When I run this size calculation code in Windows 10 Japanese Operating system  than its take only 1 millisecond each time to calculate size.

    but when i run this size calculation code  in Windows 10 English Operating system than it is taking 30 millisecond each time to calculate size.

    To verify this problem in Windows 10 English Operating system I changes temporary file path to following hard coded local drive path file path 

    filePath = D:\LocalTempFilePath\Test.tmp;

    while(true){

    .......

    UInt64 fileSize = (UInt64)(new FileInfo(filePath)).Length;

    .......

    }

    then windows 10 English Operating system takes 1 millisecond only.

    1.Why Windows 10 English operating system takes 30 millisecond each time to calculate size when I am using Operating system Temporary file ?? 

    2. Is there any difference between Japanese OS temporary file and English OS Temporary file.

    Any Solution for this problem.

    Thank you in Advance.

    Monday, November 19, 2018 1:54 AM

Answers

All replies