Leading or trailing white space characters in file names


Re: Leading or trailing white space characters in file names
#3
First of all, for those who have yet to read it, here is some context:
http://forums.ldraw.org/showthread.php?tid=1996

Michael Heidemann Wrote:If I read the header line we are talking about file names.
Technical it might work to have leading whitespace in filenames. But I would in any case disallow them for LDraw related files!
On a type 1 line there might be a reference to a file with leading whitespace. I have no clue how to detect that!!!
Trailing whitespace should not be a problem as you always have that between the letters of the filename and the dot.
I'm pretty sure it's still the LSC's official stance that all leading or trailing whitespace around the file parameter on a type 1 line is to be stripped and ignored. Fear not, my friend Smile

I believe what Orion is referring to is whether or not lines in an ldraw file with leading whitespace is legal, such as the quads in the following file:
Code:
0 I believe this is the "File Name" Orion is referring to
0 Name: somepart.dat
0 Author: Gandalf

0 // here is the ring
1 4 0 0 0 1 0 0 0 1 0 -0 0 1 ring.dat

0 // these quads will protect Frodo from the orcs
    4 16 -5 5 -2 5 5 -2 5 -5 -2 -5 -5 -2
    4 16 -5 5 -3 5 5 -3 5 -5 -3 -5 -5 -3
    4 16 -5 5 -4 5 5 -4 5 -5 -4 -5 -5 -4

0 // these quads will protect Frodo from the eye of sauron
    4 16 -5 5 2 5 5 2 5 -5 2 -5 -5 2
    4 16 -5 5 3 5 5 3 5 -5 3 -5 -5 3
    4 16 -5 5 4 5 5 4 5 -5 4 -5 -5 4

I believe the current spec allows leading whitespace in all lines except the first one (possibly what Orion is perhaps misleadingly referring to as the file name?), so that it can be used to quickly identify dat files that are not LDraw files (simply beginning with "0 " obviously doesn't guarantee anything about the rest of the file). It's really not that hard to check if the first non-whitespace character is 0 and if it is followed by a space, which (I believe) is why Orion is bringing the discussion out of the LSC forum.

I could be completely wrong here, but I'm pretty sure that's whats going on.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: Leading or trailing white space characters in file names - by Jean-Philippe Ouellet - 2012-01-18, 22:29

Forum Jump:


Users browsing this thread: 1 Guest(s)