Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: How to create a folder if one does not exists?

  1. #1

    Default How to create a folder if one does not exists?

    What's the best approach for this?


    Thanks,

    Marc Pike

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    In what? "copy files" will probably make the directory if it doesn't exist yet.

    Personally I'm not very much in favor of anything that changes the structure of database or filesystem from within an ETL tool. I always get the urge to throw staplers at people who try to do that.

    Regards,
    Sven

  3. #3
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Hi Sven, even though I agree with you as usual, I still think it's time for you to let go of that staplers fetish.

    Matt

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    Hole punching machines??? ... I got a 30 by 30 centimetre one lying around.
    My cubicle neighbour has a hammer of enlightenment lying around.

  5. #5
    Join Date
    May 2006
    Posts
    4,882

    Default

    It's not impossible to make a job entry to create a directory... maybe a JIRA request ;-)

    Regards,
    Sven

  6. #6

    Default

    It's not impossible to make a job entry to create a directory...

    --> Done. :-) I'll put it after 3.0 release

    I have added som file fonctions (createFolder, copyFile,..) in Java scrip mod..

    Take care

    Samatar

  7. #7

    Default

    Hi, just went to the Kettle training the other day. Great class though we didn't touch on this. Perhaps someone on the forum can help...

    From previous post, with respect to:
    "--> Done. :-) I'll put it after 3.0 release

    I have added som file fonctions (createFolder, copyFile,..) in Java scrip mod.."

    Where exactly do I find this? I looked all through the 'Modified java script value' step, however didn't find it. I would like to create a directory automatically as:

    '2008-05 (May)' using variables year (yyyy) month (mm) and named month (May or December, etc.).

    also, is there a way to switch to a specified directory before creating the directory? For instance, I want to switch to C:\somedir\someotherdir\ before I create the sub-dir.

  8. #8

    Default

    Quote Originally Posted by sboden View Post
    Personally I'm not very much in favor of anything that changes the structure of database or filesystem from within an ETL tool. I always get the urge to throw staplers at people who try to do that.
    Hello, sboden

    I'm outputting data to SQLite files which should be stored into dynamically created directories. The SQLite connection URL contains a variable with full path. Unfortunately SQLite-JDBC or whatever it is, doesn't create intermediate folders, so being able to create ones from inside ETL is helpful.
    In other words, I not quite agree with you on staplers =)

    Do you know any workaround for this issue in 3.0.3 prior to when Create Folders was introduced?
    Thanks,

    Ivan

  9. #9
    Join Date
    May 2006
    Posts
    4,882

    Default

    Don't underestimate the persuasive power of the stapler

    If you want to do it in PDI the only other possible ways would be some javascript pieces or executing a "shell script" to do your work.

    Regards,
    Sven

    P.S. The main reason for not liking things to dynamically change the structure of filesytems/databases is that you lose control. In a controlled environment it can be a nuisance (deleting e.g. a couple of hundred tables upon someone going wild with input)... in a non-controlled environment (where you pick data from the internet e.g.) you may open up some security holes.
    Last edited by sboden; 05-13-2008 at 09:48 AM.

  10. #10

    Post

    Quote Originally Posted by sboden View Post
    P.S. The main reason for not liking things to dynamically change the structure of filesytems/databases is that you lose control. In a controlled environment it can be a nuisance (deleting e.g. a couple of hundred tables upon someone going wild with input)... in a non-controlled environment (where you pick data from the internet e.g.) you may open up some security holes.
    Thanks, almost agree with you
    For now I will create a shell script "create_folder.sh", wich would take argument "${mydir}".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.