Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with Files
Message
From
02/09/2002 17:50:19
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00696044
Message ID:
00696045
Views:
11
This message has been marked as the solution to the initial question of the thread.
Do you mean the windows system directory? IF so:
DECLARE Integer GetSystemDirectory IN Win32API;
                String @cWinDir, Integer iSize

LOCAL lcSysDir, lnSize

lnSize   = 100
lcSysDir = SPACE(lnSize)

lnRetVal = GetSystemDirectory(@lcSysDir, lnSize)

IF lnRetVal > 0
	? LEFT(lcSysDir, lnRetVal)
	RETURN LEFT(lcSysDir, lnRetVal)
ELSE
	? "System Directory Not Found"
	RETURN ""
ENDIF
To determine the windows directory:
lcpath=WinDir()

FUNCTION WinDir()
  LOCAL lcPath, lnSize
  lcPath = SPACE(255)
  lnsize = 255
  DECLARE INTEGER GetWindowsDirectory IN Win32API ;
    STRING @pszSysPath,;
    INTEGER cchSysPath
  lnSize = GetWindowsDirectory(@lcPath, lnSize)
  IF lnSize <= 0
    lcPath = ""
  ELSE
    lcPath = ADDBS(SUBSTR(lcPath, 1, lnSize))
  ENDIF
  ? lcPath
  RETURN lcPath
ENDFUNC
To check if a file exists:
IF FILE('myfile.txt')
        ? 'The file exists'
ENDIF
>Couldn't find a command to
>1. check if a specific file exists or not.
>2. give the path of Windows O/S.
>please give me hand.
>Thanks
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform