LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read all bytes from any file

Solved!
Go to solution

Hey! I would like to read any type of file and read them as binary (Obtain an 1d array of U8 or an 2d array 8bits x sizearray) and when I have manipulated it, rebuild the original file.

0 Kudos
Message 1 of 11
(832 Views)
Solution
Accepted by topic author Pepe727

Hi Pepe,

 

I would like to read any type of file and read them as binary (Obtain an 1d array of U8 or an 2d array 8bits x sizearray)

Use ReadBinaryFile function…

 

when I have manipulated it, rebuild the original file.

Why do you want to manipulate anything, when you need the original file afterwards???

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 2 of 11
(827 Views)

Well such a vague question demands an equally vague answer.

 erre.PNG

 

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 3 of 11
(826 Views)

I wanna encrypt any file, for example a vi or a video or a simple .txt, so, when this file encrypted is decrypted...

 

The function "read binary file" is able to read any type of file?

0 Kudos
Message 4 of 11
(809 Views)

since every file is just a bunch of zeros and ones ... yes


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 5 of 11
(801 Views)

Does anyone have an example?

0 Kudos
Message 6 of 11
(796 Views)

RTSLVU had an example for the encoding,

to reverse that, you just have to do the same with F^-1 for the decoding.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 7 of 11
(786 Views)

@Pepe727 wrote:

Does anyone have an example?


The "vague answer" above is actually a good starting point!  Smiley Happy

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 8 of 11
(784 Views)

@Pepe727 wrote:

I wanna encrypt any file, for example a vi or a video or a simple .txt, so, when this file encrypted is decrypted...

 

The function "read binary file" is able to read any type of file?


See my suggestion here https://forums.ni.com/t5/LabVIEW/Can-you-give-me-some-suggestions-for-encryption-decryption/m-p/2529...

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
Message 9 of 11
(783 Views)

if you want to have "secure" encryption, use an external library/program that does that for you, like openssl, and not build it yourself.

you could run commandline call through the system-exec-vi.

https://zone.ni.com/reference/en-XX/help/371361J-01/glang/system_exec/


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 10 of 11
(772 Views)