>Assuming my code reads,
> p_path="c:\temp\"
> path_ok = FOPEN(p_path+'temp.txt',11)
>
>path_ok always returns -1 (Can't read or write)
>
>The directory does exist.
>
>I have tried all the buffer codes,
>0 Read Only Buffered
>1 Write-Only Buffered
>2 Read and Write Buffered
>10 Read-Only Unbuffered
>11 Write-Only Unbuffered
>12 Read and Write Unbuffered
>
>
>Why does it always return -1?
>
>Thanks,
Gene,
You cannot FOpen() a file that does not exist. Try this code instead;
p_path="c:\temp\"
path_ok = FOPEN(p_path+'temp.txt',11)
IF path_ok < 1
Path_ok = Fcreate(p_path+'temp.txt')
IF Path_ok < 1
WAIT WINDOW "THERE IS A PROBLEM"
ENDIF
ENDIF