[GRASS5] [bug #3124] (grass) impossible to remove imported vector file

Radim Blazek blazek at itc.it
Wed Mar 30 03:43:03 EST 2005


Hamish wrote:
>>>What is written in head file?
>>
>>thanks for the hint - the problem files have an extra empty line in
>>the header - like this
>>
>>ORGANIZATION: GRASS Development Team
>>
>>DIGIT DATE:   Tue Mar 26 13:37:29
>>DIGIT NAME:   jaro
>>MAP NAME:     NCS-GRD2.dxf
>>MAP DATE:
>>MAP SCALE:    2400
>>OTHER INFO:
>>ZONE:         0
>>MAP THRESH:   0.000000
>>
>>
>>when I remove that empty line, it works OK (d.vect displays it and
>>g.remove deletes it)
>>
>>I tried to find out why it is putting that line in and it looks like
>>this file might have been imported under MS Windows (Jaro do you
>>remember? all the files that do not work have x permissions)
>>-rw-r--r--    1 helena   helena       2163 Jan 10 22:46 wetland
>>-rwxr-xr-x    1 helena   helena       1851 Mar 29 11:46 wetlandcheckd
> 
> 
> 'file wetlandcheckd' will let you know the format.
> try dos2unix on it?
> 
> 
> 
>>let me know if I should explore this further - apparently it is the
>>data that is the problem, but we should find a better way how to
>>handle such data as other users may have something like this too,
> 
> 
> there is, use G_getl2() and not fgets() in whatever function is reading
> the header. This deals with UNIX/DOS/MacOS9 text files nicely.
> (Radim just added)

The header in < 6 is stored in the binary file, it is read by 
dig__fread_port_C and set by Vect_set_*.

Vect_set_* or should probably take care of '\n'.

Radim




More information about the grass-dev mailing list