Comments (6)
@ngblume This is not necessarily a bug with the implementation, but perhaps a bug in documentation and lacking examples.
The SFTP Attributes:Create.vi
creates an empty struct within the libssh2lv C library. This is unpopulated with actual, meaningful data about a file. The SFTP File:Read Status.vi
must be used to populate the empty Attributes struct. Structs are like clusters in LabVIEW. Before the SFTP File:Read Status.vi
is called, the SFTP Attributes can be whatever the libssh2 C library decided to use during struct initialization. It appears random values are used.
The following VI snippet should work, or at least be useful as a template to read the attributes of a file through the SFTP API:
If you have the source code and Caraya Unit Test package installed, then the Tests.lvlib:SFTP File.lvlib:Read Status.vi
test might be useful since a more complete, "official" example is not currently available.
from libssh2-labview.
Hmm, looking at the SFTP examples, specifically Simple SFTP File Download, it appears I made the same mistake and did not call the Read Status.vi
before reading the attributes. I am in the process of fixing this example.
from libssh2-labview.
I have updated the Simple SFTP File Download example to use the Read Status.vi
as of ff8facd. I will hold off on creating a new release until I get confirmation this has been resolved.
from libssh2-labview.
@volks73 That's exactly the example I based my code on.
I think for the Simple SFTP File Download.vi it makes even more sense to use the "Read Size.vi", since it contains all necessary steps and this should be a simple example with very little risk of errors..
I changed my code and it works properly now...
Except the timestamp is weird..
The context help says UNIX epoch, which for me means directly convertable in LabVIEW...
But that's not what I'm seeing...
The file was changed yesterday..
Somehow it is off by 66 years...
from libssh2-labview.
@ngblume Ha! I forgot about the Read Size.vi
. I have a vague memory of adding that VI because reading the file size is such a common need and the lower level SFTP Attributes API is a little cumbersome. I have changed the example to use the simpler Read Size.vi
as of 30b943e.
I believe it is a UNIX timestamp, which uses 1970 as the epoch year, but LabVIEW on Windows (not sure about macOS or Linux) uses 1904 as the epoch year. I thought a UNIX timestamp was directly convertable as well, but maybe I was thinking of a UTC timestamp.
from libssh2-labview.
Fixed that offset in my code
Seems fixed for me...
New release could be created...
Thanks !
from libssh2-labview.
Related Issues (20)
- SSH read sometimes not working HOT 3
- Login with PPK-file HOT 2
- Upgrade to root HOT 3
- Error -8146 at "Create from SCP Send.vi" (DLL returned status -31 "SCP Protocol Error") HOT 3
- Add example and/or VI to make folder if non-exists on remote
- Keepalive HOT 1
- Build Application HOT 2
- SSHlib freeze during init HOT 1
- Missing Files (VIPM Installation) HOT 2
- reading Prompt
- TCP/IP Channel is not accessible by other programs or VIs HOT 3
- How to use "Remote File Name" HOT 1
- Create Channel From Session fails HOT 3
- LibSSH2 has problems with some commands HOT 7
- problems with private key authentication HOT 3
- SSH Library usage with NI Xnet HOT 24
- LabVIEW 2023 and newer does not work for Linux HOT 12
- Key exchange error with connect.vi in VIPM version 1.2.4.32 with NI RT Linux 2024 HOT 8
- No password authentication error HOT 3
- Read All and Read All stderr don't work together HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libssh2-labview.