Bug #50877 Windows version of my_dir() does not set the MY_S_IFREG bit for regular files

Submitted: 3 Feb 2010 12:13 Modified: 8 Jul 2010 7:26
Reporter: Bjørn Munch Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1+ OS:Windows
Assigned to: CPU Architecture:Any

[3 Feb 2010 12:13] Bjørn Munch
Description:
After calling my_dir() to get info on the files in a directory, I try to check if it's not a regular file:

  if (!MY_S_ISREG(file->mystat->st_mode))

This does not work on Windows (this negative test is always true), and I can see from the Win version of the code that it doesn't set the MY_S_IFREG bit.

I needed this for the Windows port of the fix for Bug #39774. A workaround is to instead do:

  if (MY_S_ISDIR(file->mystat->st_mode))

, because the MY_S_IFDIR bit is set. Should be safe enough in this context.

How to repeat:
Get info from a directory that contains regular files using my_dir, then check the mystat->st_mode of each file
[8 Jul 2010 7:26] Sveta Smirnova
Thank you for the report.

Verified as described.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.