Solved

chsize() in aix

Posted on 1999-01-26
2
789 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
List out all word 7 351
CRON statement to run every 3 minutes except on Monday morning 12am to 2am 7 121
Authenticate using sesu from script 7 154
Problem to Office 1 65
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. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 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