Alaska Software Inc. - is normal this behaviour?
Username: Password:
AuthorTopic: is normal this behaviour?
Jorge Lis normal this behaviour?
on Tue, 09 Mar 2010 10:00:16 -0300
Hi to all

i run this command like this
CurDrive() + ':\' + CurDir(CurDrive()) + '\'

and somtimes show this error,

when CurDrive() can fail ?



oError:args         :
          -> VALTYPE: C VALUE:
oError:canDefault   : Y
oError:canRetry     : Y
oError:canSubstitute: N
oError:cargo        : NIL
oError:description  : Operating system error
oError:filename     :
oError:genCode      :         40
oError:operation    : curDir
oError:osCode       :        123
oError:severity     :          2
oError:subCode      :          4
oError:subSystem    : BASE
oError:thread       :          1
oError:tries        :          2
------------------------------------------------------------------------------
Jack Duijf Re: is normal this behaviour?
on Wed, 10 Mar 2010 18:50:25 +0100
Hello,

It is not CurDrive that fails, nor CurDir
There is a OS error 123.
Error 123: The filename, directory name, or volume label syntax is 
incorrect.

This means probaly that CurDrive() is empty.
This happens if you (for example) execute CurDir("\\ServerName\Sharename")

So your CurDrive() + ':\' + CurDir(CurDrive()) + '\' probably results in 
":\\\ServerName\Sharename\"

This is not a valid file or directory name in Windows.

You need to validate the full path yourself before you pass it to the OS.

Regards,
Jack Duijf


Op 9-3-2010 14:00, Jorge L schreef:
> Hi to all
>
> i run this command like this
> CurDrive() + ':\' + CurDir(CurDrive()) + '\'
>
> and somtimes show this error,
>
> when CurDrive() can fail ?
>
>
>
> oError:args :
> -> VALTYPE: C VALUE:
> oError:canDefault : Y
> oError:canRetry : Y
> oError:canSubstitute: N
> oError:cargo : NIL
> oError:description : Operating system error
> oError:filename :
> oError:genCode : 40
> oError:operation : curDir
> oError:osCode : 123
> oError:severity : 2
> oError:subCode : 4
> oError:subSystem : BASE
> oError:thread : 1
> oError:tries : 2
> ------------------------------------------------------------------------------
>
>
>
Jorge LRe: is normal this behaviour?
on Wed, 10 Mar 2010 15:40:18 -0300
Hi jack
the complete example is
cRet :=CurDrive() + ':\' + CurDir(CurDrive()) + '\'
i don´t evaluate cRet

to CurDir() fails i need to pass not valid value,
then CurDrive() return not a valid path

why "CurDrive()" not return a valid path ?, in which cases ?

Thanks and regards

"Jack Duijf" <jack@jdsoftware.nl> escribió en el mensaje de noticias 
news:4a7694d4$344fd2f9$1641@news.alaska-software.com...
> Hello,
>
> It is not CurDrive that fails, nor CurDir
> There is a OS error 123.
> Error 123: The filename, directory name, or volume label syntax is 
> incorrect.
>
> This means probaly that CurDrive() is empty.
> This happens if you (for example) execute CurDir("\\ServerName\Sharename")
>
> So your CurDrive() + ':\' + CurDir(CurDrive()) + '\' probably results in 
> ":\\\ServerName\Sharename\"
>
> This is not a valid file or directory name in Windows.
>
> You need to validate the full path yourself before you pass it to the OS.
>
> Regards,
> Jack Duijf
>
>
> Op 9-3-2010 14:00, Jorge L schreef:
>> Hi to all
>>
>> i run this command like this
>> CurDrive() + ':\' + CurDir(CurDrive()) + '\'
>>
>> and somtimes show this error,
>>
>> when CurDrive() can fail ?
>>
>>
>>
>> oError:args :
>> -> VALTYPE: C VALUE:
>> oError:canDefault : Y
>> oError:canRetry : Y
>> oError:canSubstitute: N
>> oError:cargo : NIL
>> oError:description : Operating system error
>> oError:filename :
>> oError:genCode : 40
>> oError:operation : curDir
>> oError:osCode : 123
>> oError:severity : 2
>> oError:subCode : 4
>> oError:subSystem : BASE
>> oError:thread : 1
>> oError:tries : 2
>> ------------------------------------------------------------------------------
>>
>>
>>
>
Jack Duijf Re: is normal this behaviour?
on Wed, 10 Mar 2010 19:59:46 +0100
Hello,

Ok, i see.
Please run the folowing code:

? "CurDir() = " + ShowData(CurDir())
wait
? "CurDrive() = " + ShowData(CurDrive())
wait
? "CurDir(CurDrive()) = " + ShowData(CurDir(CurDrive()))
wait
Return

Function ShowData(uData)
Return Var2Char(uData) + " (" + ValType(uData) + ")"

What are the results?

Regards,
Jack Duijf




Op 10-3-2010 19:40, Jorge L schreef:
> Hi jack
> the complete example is
> cRet :=CurDrive() + ':\' + CurDir(CurDrive()) + '\'
> i don´t evaluate cRet
>
> to CurDir() fails i need to pass not valid value,
> then CurDrive() return not a valid path
>
> why "CurDrive()" not return a valid path ?, in which cases ?
>
> Thanks and regards
>
> "Jack Duijf" <jack@jdsoftware.nl> escribió en el mensaje de noticias
> news:4a7694d4$344fd2f9$1641@news.alaska-software.com...
>> Hello,
>>
>> It is not CurDrive that fails, nor CurDir
>> There is a OS error 123.
>> Error 123: The filename, directory name, or volume label syntax is
>> incorrect.
>>
>> This means probaly that CurDrive() is empty.
>> This happens if you (for example) execute
>> CurDir("\\ServerName\Sharename")
>>
>> So your CurDrive() + ':\' + CurDir(CurDrive()) + '\' probably results
>> in ":\\\ServerName\Sharename\"
>>
>> This is not a valid file or directory name in Windows.
>>
>> You need to validate the full path yourself before you pass it to the OS.
>>
>> Regards,
>> Jack Duijf
>>
>>
>> Op 9-3-2010 14:00, Jorge L schreef:
>>> Hi to all
>>>
>>> i run this command like this
>>> CurDrive() + ':\' + CurDir(CurDrive()) + '\'
>>>
>>> and somtimes show this error,
>>>
>>> when CurDrive() can fail ?
>>>
>>>
>>>
>>> oError:args :
>>> -> VALTYPE: C VALUE:
>>> oError:canDefault : Y
>>> oError:canRetry : Y
>>> oError:canSubstitute: N
>>> oError:cargo : NIL
>>> oError:description : Operating system error
>>> oError:filename :
>>> oError:genCode : 40
>>> oError:operation : curDir
>>> oError:osCode : 123
>>> oError:severity : 2
>>> oError:subCode : 4
>>> oError:subSystem : BASE
>>> oError:thread : 1
>>> oError:tries : 2
>>> ------------------------------------------------------------------------------
>>>
>>>
>>>
>>>
>>
>
>
James Loughner Re: is normal this behaviour?
on Wed, 10 Mar 2010 16:32:16 -0500
It might happen if the drive is a mapped network drive and the
connection has been lost.

Also if the machine has been resurrected from a sleep state and perhaps
net connections are not made
Jim
On 03/10/2010 01:40 PM, Jorge L wrote:
> Hi jack
> the complete example is
> cRet :=CurDrive() + ':\' + CurDir(CurDrive()) + '\'
> i don´t evaluate cRet
> 
> to CurDir() fails i need to pass not valid value,
> then CurDrive() return not a valid path
> 
> why "CurDrive()" not return a valid path ?, in which cases ?
> 
> Thanks and regards
> 
> "Jack Duijf" <jack@jdsoftware.nl> escribió en el mensaje de noticias
> news:4a7694d4$344fd2f9$1641@news.alaska-software.com...
>> Hello,
>>
>> It is not CurDrive that fails, nor CurDir
>> There is a OS error 123.
>> Error 123: The filename, directory name, or volume label syntax is
>> incorrect.
>>
>> This means probaly that CurDrive() is empty.
>> This happens if you (for example) execute
>> CurDir("\\ServerName\Sharename")
>>
>> So your CurDrive() + ':\' + CurDir(CurDrive()) + '\' probably results
>> in ":\\\ServerName\Sharename\"
>>
>> This is not a valid file or directory name in Windows.
>>
>> You need to validate the full path yourself before you pass it to the OS.
>>
>> Regards,
>> Jack Duijf
>>
>>
>> Op 9-3-2010 14:00, Jorge L schreef:
>>> Hi to all
>>>
>>> i run this command like this
>>> CurDrive() + ':\' + CurDir(CurDrive()) + '\'
>>>
>>> and somtimes show this error,
>>>
>>> when CurDrive() can fail ?
>>>
>>>
>>>
>>> oError:args :
>>> -> VALTYPE: C VALUE:
>>> oError:canDefault : Y
>>> oError:canRetry : Y
>>> oError:canSubstitute: N
>>> oError:cargo : NIL
>>> oError:description : Operating system error
>>> oError:filename :
>>> oError:genCode : 40
>>> oError:operation : curDir
>>> oError:osCode : 123
>>> oError:severity : 2
>>> oError:subCode : 4
>>> oError:subSystem : BASE
>>> oError:thread : 1
>>> oError:tries : 2
>>> ------------------------------------------------------------------------------
>>>
>>>
>>>
>>>
>>
> 
>