Alaska Software Inc. - DirMake() return error
Username: Password:
AuthorTopic: DirMake() return error
Carlos Beling DirMake() return error
on Wed, 13 Feb 2008 17:18:28 -0300
Hi:
good afternoon.

The DirMake() from XbtTools (1.90) is returning a code that does nor
match with the ones defined in XbtSys.ch.
I attached a sample and I'd like somebody advise me what is wrong.

Beling
Best regards


x.prg
Andreas Gehrs-Pahl
Re: DirMake() return error
on Wed, 13 Feb 2008 22:30:33 -0500
Beling,

>The DirMake() from XbtTools (1.90) is returning a code that does nor
>match with the ones defined in XbtSys.ch.
>I attached a sample and I'd like somebody advise me what is wrong.

I tested your program and also tried some other directory values, but 
I couldn't get any strange error codes. Could you post here the value 
of those error codes and under what circumstances you receive them?

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Carlos Beling Re: DirMake() return error
on Thu, 14 Feb 2008 15:31:19 -0300
Hi Andreas:
good afternoon.
Many thanks.
Here is the program modified (DirMake.zip) for showing what are the errors and a print 
screen of its execution (DirMake.jpg).
Xbase++ version: 1.90.331
XbtTools: see the attached XbTools.jpg

Beling
Best regards

Andreas Gehrs-Pahl escreveu:
> Beling,
> 
>> The DirMake() from XbtTools (1.90) is returning a code that does nor
>> match with the ones defined in XbtSys.ch.
>> I attached a sample and I'd like somebody advise me what is wrong.
> 
> I tested your program and also tried some other directory values, but 
> I couldn't get any strange error codes. Could you post here the value 
> of those error codes and under what circumstances you receive them?
> 
> -- Andreas
> 
> ---                                                                      ---
>   Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>   415 Gute Street                     or: Andreas@DDPSoftware.com
>   Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>   Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---


DirMake.jpg
Dirmake.zip
XbTools.jpg
Andreas Gehrs-Pahl
Re: DirMake() return error
on Thu, 14 Feb 2008 13:07:24 -0500
Beling,

>Here is the program modified (DirMake.zip) for showing what are the errors 
>and a print screen of its execution (DirMake.jpg).

Yes, your jpg shows Error Code -183, which explains it all. 

The returned Error Codes of DirMake() are simply OS Error Codes -- which 
are also the same error codes that FError() reports -- just with a negative 
sign added. So "Abs(nErrorCode)" will give you the OS Error Code, and using 
"DosErrorMessage(Abs(nErrorCode))" will give you the correct Error Message.

OS Error 183 is actually ERROR_ALREADY_EXISTS or in clear text:
"Cannot create a file when that file already exists." And you will get this 
Error if you try to create a directory that actually exists or when a file 
with the same filename as specified for the directory already exists.

There are probably other OS Error Codes possible, so you should ignore the 
given constants and make it a generic OS Error Test Routine, instead.

Hope that helps,

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Carlos Beling Re: DirMake() return error
on Fri, 15 Feb 2008 18:58:51 -0300
Hi Andreas:
good night.
Many thanks.
The docs of DirMake() made me this kind of misunderstanding.

Beling
Best regards

Andreas Gehrs-Pahl escreveu:
> Beling,
> 
>> Here is the program modified (DirMake.zip) for showing what are the errors 
>> and a print screen of its execution (DirMake.jpg).
> 
> Yes, your jpg shows Error Code -183, which explains it all. 
> 
> The returned Error Codes of DirMake() are simply OS Error Codes -- which 
> are also the same error codes that FError() reports -- just with a negative 
> sign added. So "Abs(nErrorCode)" will give you the OS Error Code, and using 
> "DosErrorMessage(Abs(nErrorCode))" will give you the correct Error Message.
> 
> OS Error 183 is actually ERROR_ALREADY_EXISTS or in clear text:
> "Cannot create a file when that file already exists." And you will get this 
> Error if you try to create a directory that actually exists or when a file 
> with the same filename as specified for the directory already exists.
> 
> There are probably other OS Error Codes possible, so you should ignore the 
> given constants and make it a generic OS Error Test Routine, instead.
> 
> Hope that helps,
> 
> -- Andreas
> 
> ---                                                                      ---
>   Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>   415 Gute Street                     or: Andreas@DDPSoftware.com
>   Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>   Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---