The code seeks the default drive / directory:
GetDir( 0, s )
In NT it returns: D:\DEFAULT
In 98 it returns: C:\
The routine is being run in D:\DEFAULT
Does anyone have any ideas on this ?
Thanks
Tim
There are a number of differences between OS's...
Paul.
On Wed, 10 May 2000 01:44:54 GMT, "Tim Stone" <tims...@mstrlink.com>
wrote:
I found the problem, and it is interesting. First, I am doing this because
I want to write some files in the default directory. They are temporary and
then discarded.
When Install Shield installed the program, it did not set the working
directory, only the command line. So, even though the program existed on
the D drive, when it was run, it was placing everything in C:'s root.
Correcting the working directory solved the problem.
Tim
"Paul" <pa...@nospam.com> wrote in message
news:39195473...@news.indigo.ie...
Nick
I have had the same experiences with programs I have made,
in one version...no problems, in another version...error.
If "s" is defined as String, then your program should work,
according to the documentation of "GetDir(0,s)".
There is however, an extra instruction you could use.
The dis-advantage is that the program allways will start in
this directory - IF the directory exists.
Procedure xxxx;
Begin
{$i-}
ChDir('d:\default');
{$i+}
....
End;
When you use the compiler directives {$i-} and {$i+} you
should test "IOError". If you don't, the system COULD be
unstable. A call to IOError is enough (i.e. Error:=IOError).
Error should be defined as Integer, as IOError could return
a negative number.
aak.
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
function GetTempDir: String;
var
Buffer: array[0..MAX_PATH] of Char;
begin
SetString(Result, Buffer, GetTempPath(SizeOf(Buffer), Buffer));
end;
"Tim Stone" <tims...@mstrlink.com> schreef in bericht
news:GReS4.190314$bm.9...@news1.alsv1.occa.home.com...