Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

delete a directory that is not empty???

beginnerbeginner Posts: 10Member
How do i delete a dir that is not empty?
And what's that about pascal programs on a pentium 2?

Gert

Comments

  • ibyiby Posts: 323Member
    : How do i delete a dir that is not empty?
    : And what's that about pascal programs on a pentium 2?
    :
    : Gert
    :


    If you are using TP, check help for instruction RemoveDir.
    TP7 has faulty CRT unit which causes Error200. There are
    numerous patches and CRT replacements. Search this messageboard for 'Error 200' to find more.

    Iby





  • ManningManning Posts: 1,621Member
    : How do i delete a dir that is not empty?
    : And what's that about pascal programs on a pentium 2?
    :
    : Gert
    :

    I would write a procedure called DeltreeDir that would do this:

    try RemoveDir.
    if that fails, use findfirst/findnext to find everything in the dir
    as you find files, delete them
    as you find new directories, call DeltreeDir(newdirectory)
    try RemoveDir again once findfirst/findnext loop is done

    And as for the run-time error 200 bug, you just need to find the CRT patch. Shouldnt be too hard to find on google or something.

  • JaywalkJaywalk Posts: 105Member
    : How do i delete a dir that is not empty?
    : And what's that about pascal programs on a pentium 2?
    :
    : Gert
    :
    You can get command.com to do work for you. Use the DOS unit, use GetEnvVar to get the environmental variable "comspec" (this tells you where command.com is). Then use exec to call comspec, and put the DOS command you want as the parameter. The nice thing about using command.com is that you can use DOS's redirection symbols.

Sign In or Register to comment.