Scripting - Basic File IO

I can't seem to find anything on this in the WIKI.

I need to know how to use basic file in/out functions.

So for example currently I would like to use anything that does this :

1) Check if a file or directory exists.
2) Create a directory/folder.
3) Overwrite existing files without showing the 'Are you sure ?' type dialog when rendering the scene from script.

If someone could help me with those and point me at some docs if there are any that would be great :)

Cheers :)

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,866
    edited December 1969

    What sort of files - native content files, or general files? DzContentManager will handle the former, DzFileInfo and DzDir handle things like checking for existence and getting directory listings, DzFile handles I/O for non-native files. Have a look at those classes in the DS3 docs to start with.

  • Widdershins StudioWiddershins Studio Posts: 539
    edited December 1969

    HI again Richard, thanks for your attention.

    At the moment I am concerned with general images files in PNG format.

    I have some scripts that auto render some things for me and just need to create a couple of directories at the same time.

    Sounds like DzFIle is what I need then, I will take a look. I couldn't find anything before, maybe I was looking in the current docs :/

    Cheers :)

  • Richard HaseltineRichard Haseltine Posts: 100,866
    edited December 1969

    To create a directory you'd want DzDir.mkdir( name ) I think

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited February 2013

    I assume you're talking DAZ scripting and not plugins? Guess you noticed the big empty space under DAZ Studio> v4.x > Reference Guide > Scripting > API Reference > Object Index?

    However, if you go to the DAZ Studio 3.x Documentation Centre there's a DAZ Script API documentation zip download. All the File IO stuff is there, and the bits I've used so far all seem to work in DS4.5 as well. I think Rob also mentioned that there weren't a huge number of changes between the DS3.x and DS4.x scripting (but don't quote me on that!)...

    So until the DS4 scripting documentation is online it's probably the best place to start.

    Post edited by 3dcheapskate on
  • Widdershins StudioWiddershins Studio Posts: 539
    edited December 1969

    Thanks yes, that was what I needed. Many thanks :)

Sign In or Register to comment.