RE: thunk createDirectory and createFile calls
-Original Message- From: Robert Collins [mailto:[EMAIL PROTECTED] On Sat, 2003-11-15 at 02:52, Christopher Faylor wrote: It is a given that we're working in cygwin. Adding a cygwin_ to the beginning of a function is just noise. Heh, will fix... was following Ron's convention semi-blindly. Who was following Rob's suggestion for a cygwin_CreateFile semi-blindly. :^)
Re: thunk createDirectory and createFile calls
On Fri, Nov 14, 2003 at 08:41:21PM +1100, Robert Collins wrote: /* io.h Copyright 2003 Robert Collins [EMAIL PROTECTED] Copyright 2003 Ron Parker [EMAIL PROTECTED] This file is part of Cygwin. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file CYGWIN_LICENSE for details. */ #ifndef _IO_H_ #define _IO_H_ inline HANDLE cygwin_create_file (LPCTSTR file_name, DWORD access, DWORD share_mode, LPSECURITY_ATTRIBUTES sec_attr, DWORD disposition, DWORD flags, HANDLE template_file) { return CreateFileA(file_name, access, share_mode, sec_attr, disposition, flags, template_file); } inline BOOL cygwin_create_directory (LPCTSTR filename, LPSECURITY_ATTRIBUTES sec_attr) { return CreateDirectory(filename, sec_attr); ^^^ CreateDirectoryA? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developermailto:[EMAIL PROTECTED] Red Hat, Inc.
Re: thunk createDirectory and createFile calls
Robert Collins wrote: Corinna Vinschen wrote: On Fri, Nov 14, 2003 at 08:41:21PM +1100, Robert Collins wrote: inline BOOL cygwin_create_directory (LPCTSTR filename, LPSECURITY_ATTRIBUTES sec_attr) { return CreateDirectory(filename, sec_attr); ^^^ CreateDirectoryA? Ah, yeh. Also, I think LPCTSTR should be LPCSTR ? (and also in the CreateFile case) Max.
Re: thunk createDirectory and createFile calls
Max Bowsher wrote: Also, I think LPCTSTR should be LPCSTR ? (and also in the CreateFile case) Not according to MSDN. (excuse the unsigned emails, I don't have gpg setup with thunderbird on cygwin :[) Rob
Re: thunk createDirectory and createFile calls
On Sat, 2003-11-15 at 00:04, Max Bowsher wrote: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp Look at the grey box :}. Exactly. CreateFile takes LPCTSTR - but you are calling CreateFileA, which takes LPCSTR. Granted, LPCTSTR == LPCSTR when UNICODE is not defined - but if you are relying on that, you don't need to bother with the A suffix on the function, either. Ah, I'll look this up tomorrow. For now, I've done the change to not use MAX_PATH throughout cygwin, and I've broken something. So, I'm figuring out why :[. That said, I don't plan to rely on UNICODE not being defined: this code should be the same no matter what options are passed. Rob -- GPG key available at: http://members.aardvark.net.au/lifeless/keys.txt. signature.asc Description: This is a digitally signed message part
Re: thunk createDirectory and createFile calls
On Fri, Nov 14, 2003 at 08:41:21PM +1100, Robert Collins wrote: Rename CreateFile to cygwin_create_file throughout. ^^ Rename CreateDirectory to cygwin_create_directory throughout. ^^^ It is a given that we're working in cygwin. Adding a cygwin_ to the beginning of a function is just noise. cgf
Re: thunk createDirectory and createFile calls
On Sat, 2003-11-15 at 02:52, Christopher Faylor wrote: On Fri, Nov 14, 2003 at 08:41:21PM +1100, Robert Collins wrote: Rename CreateFile to cygwin_create_file throughout. ^^ Rename CreateDirectory to cygwin_create_directory throughout. ^^^ It is a given that we're working in cygwin. Adding a cygwin_ to the beginning of a function is just noise. Heh, will fix... was following Ron's convention semi-blindly. Rob -- GPG key available at: http://members.aardvark.net.au/lifeless/keys.txt. signature.asc Description: This is a digitally signed message part
Re: thunk createDirectory and createFile calls
On Sat, Nov 15, 2003 at 04:48:16AM +1100, Robert Collins wrote: On Sat, 2003-11-15 at 02:52, Christopher Faylor wrote: On Fri, Nov 14, 2003 at 08:41:21PM +1100, Robert Collins wrote: Rename CreateFile to cygwin_create_file throughout. ^^ Rename CreateDirectory to cygwin_create_directory throughout. ^^^ It is a given that we're working in cygwin. Adding a cygwin_ to the beginning of a function is just noise. Heh, will fix... was following Ron's convention semi-blindly. Well, we have a small problem with get_file_attributes and set_file_attributes. We already have two functions called get_file_attribute and set_file_attribute. Note that the difference is only the trailing 's'. I'd suggest to change the name of the exisiting functions to something a bit different so that it's less likely to confuse the two calls. get_file_permissions and set_file_permissions would be good names for them, wouldn't they? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developermailto:[EMAIL PROTECTED] Red Hat, Inc.