Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

sed disk space (non) error

Original Message
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?

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


Report Offensive Message For Removal


Response Number 1
Name: ghostdog
Date: April 15, 2008 at 03:36:19 Pacific
Subject: sed disk space (non) error
Reply: (edit)
what are you wanting to do actually.

Report Offensive Follow Up For Removal

Response Number 2
Name: TonyD123
Date: April 15, 2008 at 03:50:10 Pacific
Subject: sed disk space (non) error
Reply: (edit)
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.

Report Offensive Follow Up For Removal

Response Number 3
Name: TonyD123
Date: April 17, 2008 at 03:41:24 Pacific
Subject: sed disk space (non) error
Reply: (edit)
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.

Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: sed disk space (non) error

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




My PC has been hijacked!

Lexmark 2600 Printer Issues

btk1w1 infected start here post

Unwanted message remians on screen

Slow boot time


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

All content ©1996-2007 Computing.Net, LLC