Solved

chsize() in aix

Posted on 1999-01-26
2
766 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 104
Tab names are off by one 5 54
sameEnds challenge 3 179
Dell Alienware Graphics Amplifier Driver for non-Alienware systems 18 340
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

840 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