Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #13244

Re: directory exists

From JohnMartens <martens@tennishulp.info>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: directory exists
Date 2021-02-23 17:54 +0100
Organization A noiseless patient Spider
Message-ID <s13c11$6mq$1@dont-email.me> (permalink)
References <79dc9472-ff50-4839-aaf3-6b5fb026069ao@googlegroups.com>

Show all headers | View raw


Hope this can help

John

FUNCT IsDir( cDirectory AS STRING ) AS LOGIC
	LOCAL lRetVal := TRUE AS LOGIC
	LOCAL StruData	IS 	_WINWIN32_FIND_DATA	
	LOCAL nHandle	AS PTR
	DO CASE
	CASE Empty(cDirectory)
		lRetVal := FALSE
	CASE ! SubStr(cDirectory,2,2) == ':\'
		* see if you want full path or not
	CASE IsDriveReady(Left(cDirectory,2))
		* the drive of the path is not ready
	OTHERWISE
		lRetVal := FALSE
	ENDCASE
	*
	* check dir on the drive
	IF lRetVal	
		IF !( Right( cDirectory, 1 ) == "\" )
			cDirectory += "\"
		ENDIF
	
		nHandle	:= FindFirstFile( String2Psz( cDirectory+'*.*' ), @StruData )
		IF nHandle =  INVALID_HANDLE_VALUE
			lRetVal := FALSE
		ELSE
			CloseHandle( nHandle )
			lRetVal := TRUE		
		ENDIF
	ENDIF
RETURN lRetVal



Op 23-2-2021 om 17:38 schreef aurora baccio:
> good evening,
> I must be sure that a directory has been created.
> Is there a command to search like if (if the path exists) then (if the path does not exist) endif ? ?
> Thanks always
> Aurora Baccio
> 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

directory exists aurora baccio <aurorabaccio@gmail.com> - 2021-02-23 08:38 -0800
  Re: directory exists JohnMartens <martens@tennishulp.info> - 2021-02-23 17:54 +0100
    Re: directory exists aurora baccio <aurorabaccio@gmail.com> - 2021-02-23 10:06 -0800
    Re: directory exists "Wolfgang Riedmann" <wriedmann@gmail.com> - 2021-02-24 13:52 +0100
  Re: directory exists Fred Killet <killet@killetsoft.de> - 2021-02-25 17:47 +0100
    Re: directory exists Fred Killet <killet@killetsoft.de> - 2021-02-27 09:45 +0100

csiph-web