Makeing a new directory if one does not exist

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
bluebird
Posts: 172
Joined: Wed Sep 28, 2016 3:55 am
DBs Used: DBF

Makeing a new directory if one does not exist

Post by bluebird »

Dear mentors

How can I implement this pseudo code in HMG

cDir:="C:\HMGSave"

If .NOT. exist cDir
Create Folder // this is already in HMG
Else
msgstop ("I found one called HMGSave already")

Endif

Its the exitance check that I can't find

Thank you
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Makeing a new directory if one does not exist

Post by bpd2000 »

visit
https://vivaclipper.wordpress.com/2014/01/09/makedir/
cDir := "temp"
IF MakeDir( cDir ) == 0
? "Directory", cDir, "successfully created"
ENDIF
BPD
Convert Dream into Reality through HMG
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: Makeing a new directory if one does not exist

Post by SALINETAS24 »

Code: Select all

Local cDirFoto:=GetCurrentFolder()+"\Fotos\"   // -> Este será para guardar las fotos
//-> Si no existe el directorio de FOTOS lo creo
IF !HB_DirExists(cDirFoto)
		MakeDir(cDirFoto)
ELSE
                msgstop ("YA EXISTE")
ENDIF
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
Post Reply