Setting file attributes after download - WeOnlyDo Discussion board

Setting file attributes after download (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Jan, Thursday, October 13, 2005, 15:15 (6775 days ago)

Hallo,

would you like to post a code snipped how to set file attributes?

I use following construction:
pFtpCom->GetFile(vLclDir,bstrRemotePath);
// ( c: emp , /ftpfile.txt )
The file can be loadet to c: emp
Now, I would change the file RW Attributes to 0444 , how?
My construct throws an exception: (err=10060, timeout)
pFtpCom->SetAttributes(bstrRemotePath,vtMissing,vtMissing,vtMissing,_bstr_t( 0444 ));
// ( /ftpfile.txt , .... , 0444 )

What is here wrong?

Thanks
Jan
[:smile:]

Re: Setting file attributes after download

by wodSupport, Thursday, October 13, 2005, 15:55 (6775 days ago) @ Jan

Jan,

not sure if you want to change local or remote. If it's local, you need to use API. If you want remote, then SetAttributes is correct way, but instead of 444 as string, send 444oct = 292dec, so set 292 into Permissions argument, and that should work.

However, 10060 doesn't somehow fit into your error range.. Are you sure you got 10060 after SetAttributes call?

Kreso

Re: Setting file attributes after download

by Jan, Thursday, October 13, 2005, 16:07 (6775 days ago) @ wodSupport

Hello Kreso,

this construct works only partially:

long att=292;
pFtpCom->SetAttributes(bstrRemotePath,vtMissing,vtMissing,vtMissing,att);

Remote file becomes attributes properly.
But it throws exception:

10060 (yes!), The current connection has timeout.

Any dea?

Jan

Re: Setting file attributes after download

by wodSupport, Thursday, October 13, 2005, 17:35 (6775 days ago) @ Jan

Jan,

I still dislike that 10060 and I think it shouldn't be happening here. Can you zip and send your project to techsupport@weonlydo.com ? I'd like to check it out.

Re: Setting file attributes after download

by Jan, Friday, October 14, 2005, 10:42 (6774 days ago) @ wodSupport

Jan,

Can you zip and send your project to techsupport@weonlydo.com ? I'd like to check it out.

Hello,

you have post!

Jan