![]() |
[Generators] How to generate folders? |
Post Reply
|
| Author | |
bullitt168
Member
Joined: 28.Apr.2008 Location: Bremen, Germany Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: [Generators] How to generate folders?Posted: 28.Apr.2008 at 16:18 |
|
Hello again.
While it's easy to create Files via "filename ... write ... close" I can't find how to create folders. Giving the new Folder als part of the filename results in an "ERROR_PATH_NOT_FOUND"-Error. Is there another way? Thank you, Bastian |
|
![]() |
|
rise
MetaCase
Joined: 31.Mar.2008 Points: 22 |
Post Options
Thanks(0)
Quote Reply
Posted: 28.Apr.2008 at 16:52 |
|
You can execute external command to create folders. For example, creating folder called 'foo' would look like this (on Windows and Linux platforms): external 'mkdir foo' execute
The example above creates the folder into the current directory - if you need to create it elsewhere, use extended relative or absolute path.
|
|
![]() |
|
petri
Member
Joined: 07.May.2008 Location: Helsinki Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 07.May.2008 at 14:48 |
|
I wanted to put the folder structure creation stuff into its own bat file to avoid popping up a number of dos boxes (I know, 'cmd /C' mitigates that). But I cannot figure out how to call a bat file???
It seems that none of following works: external 'C:\tmp\myfile.bat' execute external 'cmd C:\tmp\myfile.bat' execute How should a bat file be called from a generator? Thanks! |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 07.May.2008 at 15:00 |
|
The first of those certainly works (assuming such a batch file exists, you have permissions to execute it etc.). Maybe you're being caught out by how DOS works: when running a batch file specified with a directory and file name, the working directory is not changed to that directory. E.g. if your c:\tmp\myfile.bat batch file says "mkdir foo", then "foo" will be created in the MetaEdit+ working directory, not as c:\tmp\foo.
To get your new directories created into the desired directory, either use absolute paths as arguments to mkdir, or then make the first line of the batch file simply cd to the correct directory (and maybe drive with cd /d).
|
|
![]() |
|
petri
Member
Joined: 07.May.2008 Location: Helsinki Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 07.May.2008 at 15:34 |
|
Thanks for the clarification. I figured out what the issue was: for some reason I cannot use a "pkg_build.bat" name for the bat file on my machine (winxp). Most weird, given that for example "p_b.bat" works, as does "buildpkg.bat". Must be something on my PC, no matter, I can live with that :-)
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |