Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-ID: <3929AAFC.871920F2@vinschen.de> Date: Mon, 22 May 2000 23:47:40 +0200 From: Corinna Vinschen X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14 i686) X-Accept-Language: de, en MIME-Version: 1.0 To: cygdev Subject: [RFD]: GetFileAttributes and W2K Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I want to start a discussion because of what I read in MSDN this morning: Quote: When GetFileAttributes is called on a directory containing a volume mount point, the file attributes returned are those of the directory where the volume mount point is set, not those of the root directory in the target mounted volume. To obtain the file attributes of the mounted volume, call GetVolumeNameForVolumeMountPoint to obtain the name of the target volume. Then use the resulting name in a call to GetFileAttributes. The result will be the attributes of the root directory on the target volume. This has the side effect in Cygwin that the usage of GetFileAttributes in nearly all functions in Cygwin should be replaced by a new function call (eg. cygwin_get_file_attributes) with that function sth. like that: cygwin_get_file_attributes(const char *name) { attr = GetFileAttributes(name); if (attr != -1 && attr & DIRECTORY && attr & REPARSE_POINT) { newname = GetVolumeNameForVolumeMountPoint(name); attr = GetFileAttributes(newname); } return attr; } Other problems are fhandler_disk_file::fstat() and stat_worker(). In both cases the handle to the wrong directory is opened. In both cases we would need the new win32 name for further investigation. Because all that would be too complicated (too many source to change) I would like to suggest that we change path_conv according to the above: If the input file name is the cygwin name of a directory which has a volume mounted to it, path_conv should return the name of the mounted volume as w32 name. Moreover some additions to w32api would be needed for W2K... Corinna