Computing.Net > Forums > Solaris > sed disk space (non) error

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

sed disk space (non) error

Reply to Message Icon

Name: TonyD123
Date: April 15, 2008 at 02:46:58 Pacific
OS: SunOS 5.10
CPU/Ram: 2 sparc
Product: 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?

rdds [RDDS] sed '' < long_file > long_file.out
rdds [RDDS] echo $?
0
rdds [RDDS] ls -l long*
-rw-rw---- 1 rdds pathway 60938046 Apr 15 09:27 long_file
-rw-rw---- 1 rdds pathway 49250304 Apr 15 10:19 long_file.out
rdds [RDDS] df -k .
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/rootdg/home
2031711 1948949 21811 99% /home



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: April 15, 2008 at 03:36:19 Pacific
Reply:

what are you wanting to do actually.


0

Response Number 2
Name: TonyD123
Date: April 15, 2008 at 03:50:10 Pacific
Reply:

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.


0

Response Number 3
Name: TonyD123
Date: April 17, 2008 at 03:41:24 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Disk problem scp / ssh failing intermi...


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: sed disk space (non) error

hard disk space proplem www.computing.net/answers/solaris/hard-disk-space-proplem/3626.html

Available Disk Space on a Mount point www.computing.net/answers/solaris/available-disk-space-on-a-mount-point/695.html

Disk Space Allocation www.computing.net/answers/solaris/disk-space-allocation/236.html