Hi Tim,

Sorry for the late reply, I've been on holiday for two weeks and only just saw your email.

I've added your comments to bug 23681. Thanks for making the suggestion, it's really useful to get this kind of feedback on the docs!

Cheers,
Eija

On 18/12/2011 00:15, Tim BOWMAN wrote:
Hi Eija -- Thanks for keeping the Nuke docs awesome. 

When a job goes to a renderfarm, you can have many nodes checking/creating the directory at the same time. So instead of an "if no directory, make it" you might want to wrap the os.makedirs() in a try:except so there's less possibility of a race condition.

-t

On Tue, Dec 13, 2011 at 12:56 AM, Eija Narvanen <[email protected]> wrote:
Hi Julien,

That sounds like a useful addition, so I've logged it as bug 23681.

Cheers,
Eija


On 12/12/2011 11:04, Julien Chandelle wrote:
thanks it's works
perhaps the foundry have to add this in the Python dev guide

On Mon, Dec 12, 2011 at 11:48 AM, Andy Walker <[email protected]> wrote:
You can put a check in to see if the directory already exists:

    if not os.path.isdir(dir):
        os.makedirs( osdir )

Cheer,

Andy



----- Original Message -----
From: "Julien Chandelle" <[email protected]>
To: "Nuke user discussion" <[email protected]>
Sent: Monday, 12 December, 2011 10:38:23 AM
Subject: [Nuke-users] issues with auto create directory

Hey,
I put the script to create the directory that doesn't exist before a render in init.py. I found it here : http://docs.thefoundry.co.uk/nuke/63/pythondevguide/callbacks.html#beforerender

def createWriteDir():
  import nuke, os
  file = nuke.filename(nuke.thisNode())
  dir = os.path.dirname( file )
  osdir = nuke.callbacks.filenameFilter( dir )
  os.makedirs( osdir )
nuke.addBeforeRender(createWriteDir)

When a make the first render everything is ok, he create the dir and make the render. But if I want relaunch the render and over wirte the existing file he said to me :

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "/usr/local/Nuke6.3v5/plugins/nukescripts/renderpanel.py", line 8, in render_panel

return nukescripts.showRenderDialog(_list, exceptOnError)

File "/usr/local/Nuke6.3v5/plugins/nukescripts/renderdialog.py", line 702, in showRenderDialog

d.run()

File "/usr/local/Nuke6.3v5/plugins/nukescripts/renderdialog.py", line 236, in run

nuke.executeMultiple(self._nodeSelection, frame_ranges, views, continueOnError = self._continueOnError.value())

RuntimeError: [Errno 17] File exists :

[filepath of the destination of my images]


I'm on nuke 6.3v5 and Linux

--
Julien Chandelle
GSM : +32 (0) 494 277 542
julienchandelle.be
@jimbiscuit || imdb
|| Nuke , AE & Fusion Compositor ||


_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users



--
Julien Chandelle
GSM : +32 (0) 494 277 542
julienchandelle.be
@jimbiscuit || imdb
|| Nuke , AE & Fusion Compositor ||



_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

--

Eija Närvänen, Documentation Manager

The Foundry , 6th Floor, Communications Building,

48 Leicester Square, London, WC2H 7LT, UK

Tel: +44 (0) 20 7968 6828 - Fax: +44 (0) 20 7930 8906

Web: www.thefoundry.co.uk


The Foundry Visionmongers Ltd.

Registered in England and Wales No: 4642027


_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users



_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

--

Eija Närvänen, Documentation Manager

The Foundry , 6th Floor, Communications Building,

48 Leicester Square, London, WC2H 7LT, UK

Tel: +44 (0) 20 7968 6828 - Fax: +44 (0) 20 7930 8906

Web: www.thefoundry.co.uk


The Foundry Visionmongers Ltd.

Registered in England and Wales No: 4642027


_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to