Solved

chsize() in aix

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 49
how do i create updater to My Activex application? 3 74
maxBlock challenge 30 100
haveThree challenge 22 100
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now