Blocking (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Jason @, (7470 days ago)

Just a quick question about blocking - Is it alright to mix blocking with SFTP events as long as no other SFTP procedures are called from within those events?

locked

Re: Blocking

by Jasmine, (7470 days ago) @ Jason

Jason,

I would rather say no, don't mix them but you're right - as long as you don't call blocking methods from within events, you can use both.

locked

Re: Blocking

by Jason @, (7469 days ago) @ Jasmine

Agreed, I normally wouldn't use both, but in a situation where I need to poll several directories and store certain files within those directories into an array (have to use the ListItemsEvent), I have no choice, unless I want to re-write the rest of the code to use events as well. I discovered quickly that using blocking with loops is a lot easier than trying to call a dynamic amount of subsequent downloads/uploads/renames/etc... through the doneEvent.

locked

Re: Blocking

by Jasmine, (7469 days ago) @ Jason

Jason,

agreed. BTW if you need it only for ListItemsEvent, perhaps ListItem property could help?

locked

Re: Blocking

by Jason @, (7469 days ago) @ Jasmine

Possibly. Does the ListItem property contain all the information that the ListDir method would return? I need to check whether items in a directory are directories or files, along with modification dates, filesizes, and filenames.

locked

Re: Blocking

by Jasmine, (7469 days ago) @ Jason

Jason,

yes, everything.

locked