Name: TonyD123 Date: April 15, 2008 at 02:46:58 Pacific Subject: sed disk space (non) error OS: SunOS 5.10 CPU/Ram: 2 sparc Model/Manufacturer: Sun
Comment:
My (test) system is short of disk space, and sed is truncating the output file as a result. However, as can be seen below, sed does not return an error status, so how can I prevent this from happening silently on a live system, and corrupting files? Is this a Solaris bug?
Well, I have a fairly complicated sed script which performs necessary reformatting of the file(s) prior to delivery to other parts of the system. We have tried implementing this using awk and PL/SQL (the file contents are from an Oracle database), but both have problems with line length (and PL/SQL with performance). So the sed solution seems simple, efficient and reliable, except for the disk space problem I am experiencing. The example I posted had a null sed script, to demonstrate that the size change is not due to any changes specified in the script. If I just do 'cp long_file long_file.out' I get an error message and return value 2, but sed is not being so helpful.
I have now run a truss and it shows a load of write() calls failing with ENOSPC, but the sed process carrying on regardless. And the opensolaris sed source shows that all the putc() and most of the other file handling calls have no error checking whatsoever. Pretty poor, I would say.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE