MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - [Generators] How to generate folders?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Generators] How to generate folders?

 Post Reply Post Reply
Author
Message
bullitt168 View Drop Down
Member
Member
Avatar

Joined: 28.Apr.2008
Location: Bremen, Germany
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote bullitt168 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
rise View Drop Down
MetaCase
MetaCase


Joined: 31.Mar.2008
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote rise Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
petri View Drop Down
Member
Member
Avatar

Joined: 07.May.2008
Location: Helsinki
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote petri Quote  Post ReplyReply Direct Link To This Post 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!

Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post 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).
Back to Top
petri View Drop Down
Member
Member
Avatar

Joined: 07.May.2008
Location: Helsinki
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote petri Quote  Post ReplyReply Direct Link To This Post 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 :-)

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.031 seconds.