Operating System - HP-UX
1752603 Members
5003 Online
108788 Solutions
New Discussion юеВ

does file truncate affect current file offset

 
SOLVED
Go to solution
Scotty HD
Frequent Advisor

Re: does file truncate affect current file offset

>> Dennis Handly
# You can download and use tusc to check them.
can u give me link.

if anybody have c program for truncate, pass it to me

Scotty
James R. Ferguson
Acclaimed Contributor

Re: does file truncate affect current file offset

Hi (again) Scotty:

> you have given perl script. c program would also behave similarly, correct ?

Yes. Perl's guts are written in C and hence use standard system calls. You can see this in the 'lseek(2)' and 'truncate(2)' calls. Look at the HP-UX manpages.

Some of the standard C library functions are re-implemented in Perl's internals but the overall goal is the same. Perl's 'tell(3S)' is roughly equivalent to the C function 'ftell()'.

Regards!

...JRF...



James R. Ferguson
Acclaimed Contributor

Re: does file truncate affect current file offset

Hi (again) Scotty:

You can download a 'tusc' binary from the PH-UX Porting Centre. Installation is done with 'swinstall' into the '/usr/local/bin' directory:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-8.0/

Regards!

...JRF...
Scotty HD
Frequent Advisor

Re: does file truncate affect current file offset

James R. Ferguson>>
thanks much.
i will check it.

is there a link for posix specifications for read/write/truncate/... system calls

Scotty
Dennis Handly
Acclaimed Contributor

Re: does file truncate affect current file offset

>is there a link for posix specifications for read/write/truncate/... system calls

I'm not sure. But you should trust what's on truncate(2), since Integrity HP-UX 11.31 is Unix 2003 branded.
James R. Ferguson
Acclaimed Contributor

Re: does file truncate affect current file offset

Hi (again) Scotty:

> is there a link for posix specifications for read/write/truncate/... system calls

I believe you will find what seek (no pun intended) here:

http://www.unix.org/version3/online.html

Regards!

...JRF...