Solved

chsize() in aix

Posted on 1999-01-26
2
757 Views
Last Modified: 2013-12-26
In sco-unix, there is a function chsize() which can be used to change the size of a file. What is the corresponding function in AIX ?

Thanks,

Mike
0
Comment
Question by:mikechen
2 Comments
 
LVL 3

Accepted Solution

by:
mliberi earned 50 total points
ID: 1296401
from "AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2"

truncate, truncate64, ftruncate, or ftruncate64 Subroutine

Purpose

Changes the length of regular files.

Library
Standard C Library (libc.a)

Syntax

#include <unistd.h>

int truncate (Path, Length)
const   char *Path;
off_t Length;

int ftruncate (FileDescriptor, Length)
int FileDescriptor;
off_t Length;

The Path parameter must point to a regular file for which the calling process has write permission. The Length parameter specifies the
desired length of the new file in bytes.

The Length parameter measures the specified file in bytes from the beginning of the file. If the new length is less than the previous length,
all data between the new length and the previous end of file is removed. If the new length in the specified file is greater than the previous
length, data between the old and new lengths is read as zeros. Full blocks are returned to the file system so that they can be used again,
and the file size is changed to the value of the Length parameter.

If the file designated in the Path parameter names a symbolic link, the link will be traversed and path-name resolution will continue.

These subroutines do not modify the seek pointer of the file.

0
 

Author Comment

by:mikechen
ID: 1296402
Thank you very much.

Mike

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question