Howdy, Stranger!

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

Categories

Creating Folders and Moving Files

BravoknightBravoknight Member Posts: 35
is there a way to create a folder on the hard drive and then set it in the program that whatever i create, will go into that folder???

Comments

  • billywm664billywm664 Member Posts: 176
    Yes. You can manage files and directories (folders) either by BASIC's limited commands (depending on which BASIC language you're using), or go through DOS with the SHELL command.

    To make a folder:
    MKDIR "root:fullpath"

    where root is the "root" directory - usually, C.
    fullpath is the complete location where you want the folder to be. So if you wanted to make a folder on the C drive called foldernw, you would do:

    MKDIR "C:foldernw"

    When you make a new file with an OPEN command, it's created in the currently active directory. You can switch which directory you're in by the CHDIR command:

    CHDIR "root:fullpath"

    If your dialect of BASIC doesn't have these commands (although it should), you can use the SHELL to give the corresponding commands to DOS.

    SHELL "MKDIR root:fullpath" to make folders
    and
    SHELL "CD root:fullpath" to change directories, the equivalent of basic's CHDIR.


    : is there a way to create a folder on the hard drive and then set it in the program that whatever i create, will go into that folder???
    :


  • danesbensendanesbensen Member Posts: 10
    : is there a way to create a folder on the hard drive and then set it in the program that whatever i create, will go into that folder???
    :
    In SheerPower 4GL (available here for free), creating folders and subfolders is implied when opening a file with a path:

    open #1: name 'c:myfiles
    ewplaceafile.txt', access output

    This will create all of the necessary folders and subfolders.

    http://www.ttinet.com/sheerpower
  • Justin BibJustin Bib USAMember Posts: 0

    ________ // http://forcoder.org // free ebooks and video tutorials about / C Assembly Scratch JavaScript Visual Basic Java Visual Basic .NET Go Delphi Perl R Swift MATLAB PL/SQL PHP Objective-C C# Ruby Python C++ ABAP D Bash Alice Apex SAS Hack Prolog Kotlin Scheme Julia Logo Fortran Scala F# Dart LabVIEW Awk Clojure Ada Transact-SQL VBScript ML Lisp FoxPro Crystal Erlang Rust Lua COBOL / _____

Sign In or Register to comment.