QDesktopServices::openUrl and gvfs-open issue - c++

I'm trying to open a local file using QDesktopServices::openUrl under ubuntu, it appears to use gvfs-open .If the file name is correct, then the PDF pops up .
If the file name is wrong, of course gvfs-open does not manage to open the file.However,the return value of the function is true. That is, the function does not detect that the PDF failed to open the file.
What should I do to get the correct result of opening?
Any help will be appreciated

You can detect if file exists with QFile::exists
before calling openUrl()

Related

FileExistsError: [WinError 183] Cannot create a file when that file already exists:

i when run this test program create the below error.
import shutil
src=r"G:\aaa"
dst=r"F:\zzz"
shutil.copytree(src,dst, symlinks=False, ignore=None)
FileExistsError: [WinError 183] Cannot create a file when that file already exists:
but the the folder of F:\zzz is empty!!!
shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False, dirs_exist_ok=False)
dirs_exist_ok dictates whether to raise an exception in case dst or any missing parent directory already exists.
Python 3.8 now have support of dirs_exist_ok parameter. This won't give that error anymore and overwrite the destination folder in case it already exists.
Hence you need to use:
shutil.copytree(src, dst, dirs_exist_ok=True)
"Cannot create a file when that file already exists" is a generic Windows message which is confusing because it's the same for directories or regular files. (Windows isn't known for very helpful error messages, you have to make do with that)
from the online help of shutil.copytree:
>>> help(shutil.copytree)
Help on function copytree in module shutil:
copytree(src, dst, symlinks=False, ignore=None, copy_function=, ignore_dangling_symlinks=False)
Recursively copy a directory tree.
The destination directory must not already exist.
So first time it probably works, but other times you need to perform
shutil.rmtree(dst)
to remove the destination directory prior to copying the tree (note that Windows is annoying with permissions and that files with read-only attribute can choke shutil.rmtree, which I personally copied the code into a custom version (you're encouraged to do so in the online help) to add a os.chmod(path,0o777) prior to deleting regular files.

What is customer/service_head.tpl file in Xcart?

Am newbie in X cart.
How load customer/service_head.tpl in Xcart and not included,I can't saw that file in skin/customer folder.Is there any process to run that file display in x cart?Am So confused don't know what's wrong.
Please Give me Solution.
The file is located here
./skin/common_files/customer/service_head.tpl
The file is loaded from the file like
skin/your_skin_name/customer/home.tpl: {include file="customer/service_head.tpl"}
or from
skin/common_files/customer/home.tpl by default
Try our 'Webmaster mode' feature
https://demo.x-cart.com/demo_goldplus/admin/editor_mode.php
https://help.x-cart.com/index.php?title=X-Cart:Using_Webmaster_mode

Immuconf with Clojure not handling tree config files

Whenever I add a third config file to my .immuconf.edn I get:
No configuration files were specified, and neither an .immuconf.edn file nor
an IMMUCONF_CFG environment variable was found
This is driving me crazy since I cant really find anything wrong.
Using this loads thing OK:
["configs/betfair.edn" "configs/web-server.edn"]
however this generated an error:
["configs/betfair.edn" "configs/web-server.edn" "~/betfair.edn"]
This is the content of betfair.edn
{:betfair {:usr "..."
:pwd "..."
:app-key "..." ;; key used
:app-key-live "..."
:app-key-test "..."}}
(where ... is replaced with actual strings)
Why am I getting this error when adding the third file and how can I fix this?
Make sure that the last file specified in your <project dir>/.immuconf.edn (~/betfair.edn) exists in your home directory.
Immuconf does some magic to replace ~ in filenames specified in .immuconf.edn with a value of (System/getProperty "user.home") so you might check if that system property points to the same directory where your ~/betfair.edn file is located.
I have recreated your setup and it works on my machine so it is probably a problem with locations or access rights to your files. Unfortunately, error handling for the no arg invocation of (immuconf.config/load) doesn't help in troubleshooting as it swallows any exceptions and returns nil. That exception would probably tell you what kind of error occured (some file not found or some IO error happened). You might want to file a pull request with a patch to log such errors as warnings instead of ignoring them.

informatica is taking the source file as the indirect file

I had made a source file data type change in source analyzer. I did realize that it had made the mapping invalid. I ran the mapping and it failed. Now I reverted the change, validated the mapping, check in the mapping, validated the workflow, check in the workflow.
Now I am getting the error:
Severity Timestamp Node Thread Message Code Message
INFO 7/23/2015 10:40:03 AM node01_CSADevelopment READER_1_4_1 FR_3055 Reading input filenames from the indirect file [<input_directory_folder>/<input_file>].
Severity Timestamp Node Thread Message Code Message
ERROR 7/23/2015 10:40:03 AM node01_CSADevelopment READER_1_4_1 FR_3000 Error opening file [<input_file_folder>/<header_of_the_input_file>]. Operating system error message [No such file or directory].
here the term "input file" is the file which I wanted to load and "header_of_the_input_file" is the header of the input file.
I don't understand, why it is happening. I had just made a small change and then reverted it.
The error is just saying the filenames mentioned in the indirect file are not found. So, you just need to make sure all the source files are there in the "input_file_folder"
There is a property in the session to configure the source file as indirect. An indirect file contains a list of source filenames. Informatica reads all the files listed and loads the data. If you think you have inadvertently made the source file indirect, you can change the option in session properties (mapping tab -> Source Qualifier)
It does not have anything to do with the datatype change and reverting it.

Verify digital signature within system32/drivers folder

I've spent all night researching this without a solution.
I'm trying to verify the digital signature of a file in the drives folder (C:\Windows\System32\drivers*.sys) pick whatever one you want. I know that the code is correct because if you move the file from that folder to C:\ the test works.
WinVerifyTrust gives error 80092003
http://pastebin.com/nLR7rvZe
CryptQueryObject gives error 80092009
http://pastebin.com/45Ra6eL4
What's the deal?
0x80092003 = CRYPT_E_FILE_ERROR = An error occurred while reading or writing to the file.
0x80092009 = CRYPT_E_NO_MATCH = No match when trying to find the object.
I'm guessing you're running on a 64-bit machine and WOW64 file system redirection is redirecting you to syswow64\drivers, which is empty. You can disable redirection with Wow64DisableWow64FsRedirection().
if you right click and view properties of file can you see a digital signature? most likely your file is part of a catalogue and you need to use the catalogue API to extract the cert from cert DB and verify it.