Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Stream.openFile could not find file on windows #107

Closed
woodgear opened this issue Mar 11, 2019 · 3 comments
Closed

Stream.openFile could not find file on windows #107

woodgear opened this issue Mar 11, 2019 · 3 comments

Comments

@woodgear
Copy link

sciter dll version: 4.2.6.10 (32)
sciter binding : sciter-rs = "0.5.44"
windows version :win10 64

extern crate sciter;
fn main() {
    let mut frame = sciter::WindowBuilder::main_window().create();
    frame.load_file(r#"C:\Users\developer\Desktop\test_sciter_file\main.html"#);
    frame.run_app();
}
<html>
    <head>
        <title>Test</title>
        <script type="text/tiscript">
        function getData(path) {
            var config = Stream.openFile(path);
            if(config)
            {
                // Load the contents of the file into a json object 
                var jsonData = parseData(config);
            
                if(jsonData){
                stdout.printf("JSON data is : %v\n", jsonData);
                }
                else{
                stdout.println("No data");
                }
                config.close();
            }else {
                stdout.println("could not find file ",path);                
            }
        }
        getData("config.json");
        getData(self.url("config.json"));
        getData("C:\\Users\\developer\\Desktop\\test_sciter_file\\config.json");
        getData("C:/Users/developer/Desktop/test_sciter_file/config.json");            
        getData(".\\config.json");
        getData(self.url(".\\config.json"));
        getData(self.url("config.json"));
        getData(self.url("test_sciter_file\\config.json"));
    </script>
    </head>
    <body>
        <button #t>TEST</button>
    </body>
</html>

output is

INFO:TIS: could not find file  config.json
INFO:TIS: could not find file  file://C:/Users/developer/Desktop/test_sciter_file/config.json
INFO:TIS: could not find file  C:\Users\developer\Desktop\test_sciter_file\config.json
INFO:TIS: could not find file  C:/Users/developer/Desktop/test_sciter_file/config.json
INFO:TIS: could not find file  .\config.json
INFO:TIS: could not find file  file://C:/Users/developer/Desktop/test_sciter_file/config.json
INFO:TIS: could not find file  file://C:/Users/developer/Desktop/test_sciter_file/config.json
INFO:TIS: could not find file  file://C:/Users/developer/Desktop/test_sciter_file/test_sciter_file/config.json

file struct is

    Directory: C:\Users\developer\Desktop\test_sciter_file


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        3/11/2019   5:52 PM                src
d-----        3/11/2019   5:54 PM                target
-a----        3/11/2019   5:52 PM             19 .gitignore
-a----        3/11/2019   5:54 PM           3125 Cargo.lock
-a----        3/11/2019   5:54 PM            154 Cargo.toml
-a----        3/11/2019   6:03 PM            110 config.json
-a----        3/11/2019   6:13 PM           1231 main.html
-a----        2/20/2019   6:35 AM        5328376 sciter.dll
-a----        3/11/2019   6:10 PM             77 test.cmd
-a----        3/11/2019   6:17 PM         269824 test_sciter_file.exe

i am confuse what happen now,please give some advise

@pravic
Copy link
Contributor

pravic commented Mar 11, 2019

Isn't this related to the "4.2.5.0" breaking change?

@woodgear
Copy link
Author

T_T it seems so (almost waste me a whole day) . I think we should add those kinds of tip into tiscript api document.if you could tell me how to update that, i will be pleasured to do.

@pravic
Copy link
Contributor

pravic commented Mar 11, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants