[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => mxstu [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> change into a directory to create other folders/directory - Coldfusion - Getting Started

change into a directory to create other folders/directory - Coldfusion - Getting Started

I need to create sub folders in a parent folder.. i have ... <cfset session.parentdir = "e:\mainstuff\"> <cfdirectory action="create" directory="#session.parentdir##getid.id#\new"> <cfdirectory action="create" directory="#session.parentdir###getid.id#\bad"> creats e:\mainstuff each time.. how do i make this first go into the mainstuff THEN create getid\new ?...

  1. #1

    Default change into a directory to create other folders/directory

    I need to create sub folders in a parent folder..

    i have ...

    <cfset session.parentdir = "e:\mainstuff\">


    <cfdirectory action="create" directory="#session.parentdir##getid.id#\new">
    <cfdirectory action="create" directory="#session.parentdir###getid.id#\bad">

    creats e:\mainstuff each time..

    how do i make this first go into the mainstuff

    THEN create getid\new ?



    sc Guest

  2. #2

    Default Re: change into a directory to create otherfolders/directory

    creats e:\mainstuff each time..

    What do you mean creates it every time?
    mxstu Guest

  3. #3

    Default Re: change into a directory to create other folders/directory

    You have to check to see if mainstuff folder exists each time and then
    create another getit\new folder. This way you can be sure to create new
    folder each time.


    Jens


    "sc" <myis10_nospam_covad.net> skrev i meddelandet
    news:dbdn7t$8q8$1forums.macromedia.com...
    >I need to create sub folders in a parent folder..
    >
    > i have ...
    >
    > <cfset session.parentdir = "e:\mainstuff\">
    >
    >
    > <cfdirectory action="create"
    > directory="#session.parentdir##getid.id#\new">
    > <cfdirectory action="create"
    > directory="#session.parentdir###getid.id#\bad">
    >
    > creats e:\mainstuff each time..
    >
    > how do i make this first go into the mainstuff
    >
    > THEN create getid\new ?
    >
    >
    >

    Jens Hauser Guest

  4. #4

    Default Re: change into a directory to create otherfolders/directory

    You have to check to see if mainstuff folder exists each time...
    I tested this under MX 6.1, and it was not necessary to check or create the
    "mainstuff" directory first. That directory was automatically created when the
    first child directory was created.

    The attached code produced the following directory structure:
    d:\mainstuff\ ---- contents
    d:\mainstuff\23
    d:\mainstuff\89
    d:\mainstuff\92
    d:\mainstuff\23\bad
    d:\mainstuff\23\new
    d:\mainstuff\89\bad
    d:\mainstuff\89\new
    d:\mainstuff\92\bad
    d:\mainstuff\92\new



    <!--- create a test query with 3 records --->
    <cfset getID = queryNew("ID")>
    <cfset QueryAddRow(getID, 3)>
    <cfset QuerySetCell(getID, "ID", 23, 1)>
    <cfset QuerySetCell(getID, "ID", 89, 2)>
    <cfset QuerySetCell(getID, "ID", 92, 3)>

    <cfset session.parentdir = "d:\mainstuff\">

    <cfoutput query="getID">
    <cfif NOT DirectoryExists("#session.parentdir##getid.id#\new ")>
    <cfdirectory action="create" directory="#session.parentdir##getid.id#\new">
    </cfif>
    <cfif NOT DirectoryExists("#session.parentdir##getid.id#\bad ")>
    <cfdirectory action="create" directory="#session.parentdir##getid.id#\bad">
    </cfif>
    </cfoutput>

    mxstu Guest

Similar Threads

  1. Change Directory
    By christina_nz in forum Macromedia Contribute Connection Administrtion
    Replies: 0
    Last Post: February 1st, 08:49 PM
  2. Replies: 2
    Last Post: October 8th, 09:57 AM
  3. Create Directory
    By John in forum ASP.NET Security
    Replies: 2
    Last Post: August 30th, 03:24 AM
  4. Replies: 1
    Last Post: July 4th, 12:23 AM
  5. Replies: 1
    Last Post: May 21st, 03:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •