Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I create directories from withinn Clipper?

185 views
Skip to first unread message

Carlos Andres

unread,
Dec 6, 2001, 10:41:39 PM12/6/01
to
Hi everyone!

This should be a very easy question for all Clipperheads around.
Can I create directories from pure Clipper language?
If so, how?

Thanks in advance


Klas Engwall

unread,
Dec 10, 2001, 4:55:57 PM12/10/01
to
Carlos,

>Can I create directories from pure Clipper language?

I suppose that depends on how you define "pure" :-)

Clipper itself has no such function but Clipper Tools has. FUNCky also
has one. And GT_Lib. The latter is public domain and can be found at
the Oasis.

HTH,
Klas

-------
klas dot engwall at engwall dot com

Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]

Stephen Quinn

unread,
Dec 10, 2001, 4:52:24 PM12/10/01
to
Carlos

Yes
1 - Nanforum library from the OASIS (MKDIR())
2 - Clipper Tools III (MakeDir() or is it DirMake())
3 - Shell to DOS and use the 'MD' command

--
HTH
Steve Quinn

"Carlos Andres" <cac0...@terra.es> wrote in message
news:1103_10...@news.terra.es...

Royce Heckman

unread,
Dec 10, 2001, 8:23:36 PM12/10/01
to
The function directory() (in clipper 5.x) returns
1. file name
2. size
3. date
4. time
5. attributes
All of these are in an array, and can be extracted as needed.
Royce

Carlos Andres wrote:

______________________________________________________________________________
Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net

Rimantas Usevicius

unread,
Dec 13, 2001, 7:42:09 AM12/13/01
to
Hi Carlos ! To create directory you can use mkdir command with run from
Clipper . Short sample :

cMyNeedFulDir := "c:\mydir"

cMacro := "mkdir " + alltrim( cMyNeedFullDir )
run &cMacro

That's all ! With best regards ! Rimantas .

"Carlos Andres" <cac0...@terra.es> wrote in message
news:1103_10...@news.terra.es...

Martin Imber

unread,
Dec 14, 2001, 4:50:01 AM12/14/01
to
This is how I check and create my temporary directory - all in Clipper

IF LEN(DIRECTORY('C:\GT2TEMP','D')) == 0
DIRMAKE('C:\GT2TEMP')
ENDIF

Jules Alberts

unread,
Dec 14, 2001, 7:25:40 AM12/14/01
to

i always use this UDF (which uses ca-tools functions) i made a few
years ago. use it to (4dos / bash style) push / pop a dir like cDir :=
pushdir("c:\foo\bar") ; do_it() ; popdir(cDir). you can also force the
creation of the directory. it uses some simple recursion to go back to
the starting point. return value is name of current drive + dir or an
empty string when it fails.

use at your own risk, distribute freely, blah, etc. etc.

function pushdir(cDir, lCreate)
local cCurrent := diskname() + ':\' + curdir()
if cDir == NIL ; return ('') ; endif
default lCreate to .f. // if NIL, .f.
cDir := delslash(cDir)
if diskchange(substr(cDir, 1, 1))
if len(cDir) > 2 // there's a path
if dirchange(substr(cDir, 3, len(cDir))) != 0
// we can't get there...
if lCreate// ...may we create?
if !(makedir(substr(cDir, 3, len(cDir)))) == 0
// it didn't work, restore dir...
pushdir(cCurrent)
// ...and return a failure
cCurrent := ''
endif
else // makedir is a no go, leave
pushdir(cCurrent)
cCurrent := ''
endif
endif
endif
endif
return (cCurrent)

function delslash(cString)
// remove a backslash when it's the last part of a string, unles the
// string is 3 pos long (then it's probably a drive)
cString := alltrim(cString)
if len(cString) > 3
if substr(cString, len(cString), 1) == '\'
cString := substr(cString, 1, len(cString) - 1)
endif
endif
return (cString)

--
Jules Alberts

Lee Clinkscales

unread,
Dec 14, 2001, 10:16:39 AM12/14/01
to
"Martin Imber" <mar...@jotika.co.uk> wrote in message
news:dflS7.895$GW5.58300@NewsReader...


Martin,

Me too, but this requires version 5.3x. DIRMAKE is not available in
previous versions.


Lee Clinkscales
See header:Organization for obvious change to email address

alvaro valdenebro

unread,
Dec 14, 2001, 5:32:06 PM12/14/01
to
In Clipper 5.3b, you have Fast librarie, and the function DIRCREATE().

Regards from Málaga (Spain)

Alvaro

Carlos Andres <cac0...@terra.es> wrote in message news:<1103_10...@news.terra.es>...

Martin Imber

unread,
Dec 18, 2001, 8:53:09 AM12/18/01
to
I find 5.2 too restrictive


Gabriel Ledezman

unread,
Jan 2, 2002, 4:16:01 PM1/2/02
to
In clipper 5.2x mkdr() In clipper 5.3x makedir()

--
Posted via dBforums
http://dbforums.com

Ray Marron

unread,
Jan 2, 2002, 4:31:54 PM1/2/02
to
Gabriel Ledezman <mem...@dbforums.com> wrote in message
news:3c337891$3...@usenetgateway.com...

> In clipper 5.2x mkdr() In clipper 5.3x makedir()

There is no such function in built-in to 5.2. Did you even read the rest of
this thread?

--
Ray Marron

0 new messages