Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » [Solved] SFTPBrowser example build failed (SFTPBrowser example buil error: error LNK2019: unresolved external symbol __imp_CertCloseStore referenced in function winstore_close)
Re: SFTPBrowser example build failed [message #61304 is a reply to message #61301] Sun, 22 December 2024 02:30 Go to previous messageGo to previous message
Scott_Huang is currently offline  Scott_Huang
Messages: 27
Registered: December 2024
Promising Member
Hi Oblivion,


I try remove SFtp::TRUNCATE as you said, it did not work, same error.

I also testing remove both SFtp::CREATE|SFtp::TRUNCATE from SFtpStream.cpp, then the behavior like below:
1. Failed if SFTP file not existing, it show error: Failed opening remote file. I think it caused by I remove SFtp::CREATE flag too.
2. I try use other SFTP software to upload same file firstly. And then U++ exe can upload file, but it would write content to existing file, double contents.

There should be have other subtle gaps if compare to OpenWrite function:
Open(path, CREATE | WRITE, IRALL | IWUSR);


I personal guess it caused by below code, so add several RLOG for debug: (test.txt file size is 47 byte)
	if(handle) {
		RLOG("Have handle, before checking GetAttrs");
		SFtpAttrs attrs;
		if(!sftp->GetAttrs(handle, attrs)) {
			RLOG("Failed get attrs");
			sftp->Close(handle);
			handle = nullptr;
			return false;
		}
		else{
			RLOG("Succes get attrs");
			RLOG("===Show filesize");
			DUMP(attrs);
			RLOG(attrs.filesize);
			RLOG((int64)attrs.filesize);
			RLOG("----");
		}
		OpenInit(mode, attrs.filesize);
	}

void BlockStream::OpenInit(dword mode, int64 _filesize) {
	

	streamsize = _filesize;
	
	RLOG(String()<<"++In OpenInit function - DEBUG: file size"<<_filesize);
	RLOG(_filesize);
	RLOG(streamsize);
	RLOG("---------------");
	


LOG does show attributes retrievedm, so the issue should be in function OpenInit(mode, attrs.filesize); And why additional session created
SSH: Session, oid: 1: Starting DNS sequence locally for deft.dell.com:22
SSH: Session, oid: 1: Successfully connected to deft.dell.com:22
SSH: Session, oid: 1: Using Upp's memory managers.
SSH: Session, oid: 1: Session successfully initialized.
SSH: Session, oid: 1: Compression is disabled.
SSH: Session, oid: 1: Handshake successful.
SSH: Session, oid: 1: Authentication methods list successfully retrieved: [publickey,password,keyboard-interactive]
SSH: Session, oid: 1: Client succesfully authenticated.
SSH: SFtp, oid: 2: Session successfully initialized.
SSH: SFtp, oid: 2: Symbolic link operation is successful. Target: /
SSH: SFtp, oid: 2: Directory '/' is successfully opened.
SSH: SFtp, oid: 2: Directory listing is successful. (6 entries)
SSH: SFtp, oid: 2: File handle freed.
SSH: SFtp, oid: 2: Directory '//msp' is successfully opened.
SSH: SFtp, oid: 2: Directory listing is successful. (3 entries)
SSH: SFtp, oid: 2: File handle freed.
SSH: SFtp, oid: 2: Directory '//msp/config' is successfully opened.
SSH: SFtp, oid: 2: Directory listing is successful. (171 entries)
SSH: SFtp, oid: 2: File handle freed.
SSH: SFtp, oid: 2: Directory '//msp/config/temp' is successfully opened.
SSH: SFtp, oid: 2: Directory listing is successful. (2 entries)
SSH: SFtp, oid: 2: File handle freed.
dest: //msp/config/temp\test.txt, UnixPath: //msp/config/temp/test.txt
++In OpenInit function - DEBUG: file size47
47
47

---------------
SSH: SFtp, oid: 3: Session successfully initialized.
SSH: SFtp, oid: 3: File '//msp/config/temp/test.txt' is successfully opened.
Have handle, before checking GetAttrs
SSH: SFtp, oid: 3: File attributes successfully retrieved.
Succes get attrs
===Show filesize
839918903936
839918903936
----
++In OpenInit function - DEBUG: file size839918903936
839918903936
839918903936
---------------

DEBUG: NOT READ
SSH: SFtp, oid: 3: EOF received.
SSH: SFtp, oid: 3: Stream write error.
SSH: SFtp, oid: 3: File handle freed.
SSH: SFtp, oid: 2: Directory '//msp/config/temp' is successfully opened.
SSH: SFtp, oid: 2: Directory listing is successful. (3 entries)
SSH: SFtp, oid: 2: File handle freed.
SSH: SFtp, oid: 3: Session deinitalized.
SSH: SFtp, oid: 2: File '//msp/config/temp/test.txt' is successfully deleted.
SSH: SFtp, oid: 2: Directory '//msp/config/temp' is successfully opened.
SSH: SFtp, oid: 2: Directory listing is successful. (2 entries)
SSH: SFtp, oid: 2: File handle freed.


Questions: Why addition SSH oid created? Why file size wrong?

Anyway, I am ok with my last post to use worker.OpenWrite & worker.Put, it worked.

Attach good code here for others reference.

Regards,
Scott Huang

[Updated on: Sun, 22 December 2024 07:12]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Latest U++ PDF version user guide to describe framework/tips/examples
Next Topic: The UPP looks good -> Opportunities to evolve to better support RPA & AI
Goto Forum:
  


Current Time: Tue Aug 05 14:42:13 CEST 2025

Total time taken to generate the page: 0.02644 seconds