The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Write to File

SercoSteveB
Active Participant

What is the size in bytes of DataFile.txt following execution of the VI?

Write To File 23_12_2014.png

a) 17

b) 18

c) 19

d) Undefined (Format Into File returns an error)

Comments
crossrulz
Knight of NI

1) There is no DataFile.txdt being created.

2) The answer is actually OS dependent.

For a Windows program, C.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
MrStevenUND
Member

To answer the question as written, E) unknown.  Depends on if it already exists.

For the question he meant, C) 19 for windows.  I don't konw about other platforms.  From help:  \n -> The Format Into File function automatically converts this code into the platform-dependent end-of-line character.

crossrulz
Knight of NI

In Linux or MAC, the answer would be B.  I don't remember exactly which one uses which End Of Line value, but I know it is a single byte.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
sathishp91
Member

This function converts new lines, or \n, in the format string into the platform-specific end-of-line character, for example, CR/LF on Windows, CR on Mac OS X, and LF on Linux

sathishp91
Member

I checked the output in Windows platform.Result is 18.now i am bit confused

mini09
Active Participant

C, That was great info Crossrulz...

MrStevenUND
Member

Oops.  I mis-counted lastnight.  With my reasoning, it was B) 18 - 5+5+7+EOL, where EOL was just the CR.

Most of the time when I deal with manual minipulation of text strings like that, I put both the CR and LF.

From Wikipedia, here are the EOLs for each platform


SoundNLight
Member

Answer is 18 on the Mac.

SercoSteveB
Active Participant

Answer: C.  Nice one crossrulz & gnshmrthy.

Some great stuff on the thread thanks all.

mssorters
Member

C