Sponsored Content
Top Forums Programming How to get free disk space size in C/C++ program( Solaris system) Post 302130621 by prasad11 on Tuesday 7th of August 2007 05:26:20 AM
Old 08-07-2007
Error need to help to test in linux

hi,

i have written the code to find free space for linux using native code of java like below.

#include <sys/statvfs.h>

JNIEXPORT jlong JNICALL Java_NativeUtils_getDiskFreeSpace
(JNIEnv *env, jclass obj, jstring path) {
struct statvfs fiData;
struct statvfs *fpData;
//char fnPath[128];
int i;
const char *str = (*env)->GetStringUTFChars(env, path, 0);
jlong ret;

if((statvfs(str,&fiData)) < 0 ) {
printf("Failed to stat %s:\n", str);
} else {
printf("\tblock size: %u\n", fiData.f_bsize);
}
(*env)->ReleaseStringUTFChars(env, path, str);
ret = (jlong)fiData.QuadPart;
return ret;
}

if any person is having the linux os and can u please test and get back to me

thanks,
prasad
 

10 More Discussions You Might Find Interesting

1. Programming

free disk space calc

I everybody!! How can i use statvfs() to calculate disk usage and free disk space?? Im using this code: /* Any file on the filesystem in question */ char *filename = "/home/nesto/test/test.cpp"; struct statvfs buf; if (!statvfs(filename, &buf)) { ... (1 Reply)
Discussion started by: ninjanesto
1 Replies

2. Solaris

command to find free disk space on solaris

In linux df is the command to find free space what is the equivalent command in the Solaris (2 Replies)
Discussion started by: harishankar
2 Replies

3. AIX

AIX Free disk space

Hello, I would like to free some space to install gcc with is about 50M large, and I have no free space on my system. What can I delete? Filesystem 1024-blocks Used Free %Used Iused Ifree %Iused Mounted on /dev/hd4 262144 145436 116708 56% 7981 ... (10 Replies)
Discussion started by: aixn00b
10 Replies

4. Solaris

command to get the total disk space (available + free)

is there a command to get the total disk space (available + free) on the solaris server ? thanks (3 Replies)
Discussion started by: sudhiroracle
3 Replies

5. Solaris

Disk free space planning for Sol 10 LU

I'm getting ready to start a LU from Sol 9 to Solaris 10. I want to ensure that I have enough disk space for future upgrades. What I don't know is what free space Solaris requires. If I have 10GB of free space in /opt, will Solaris 10 use that for a LU? Or, do I need to allocate 10GB of space... (5 Replies)
Discussion started by: zeekstern
5 Replies

6. Solaris

free size of disk group

Hello Good morning all, Am not understanding the size of subdisk & group(length &offset).how we need to calculate this? Can anyone suggest me ? Thanks, Gowtham ---------- Post updated at 12:48 PM ---------- Previous update was at 08:30 AM ---------- I got the answer ... if want the... (0 Replies)
Discussion started by: gowthamakanthan
0 Replies

7. Shell Programming and Scripting

Free space at disk

Hi, I would like to create the new file system(mount point) in our unix server. before that i would like to know the total free space available in /home directory. Can you please let me know, how to find free space available for new filesystem? Be careful with your spelling and... (2 Replies)
Discussion started by: koti_rama
2 Replies

8. Solaris

Determine free space in a Disk device

Version: Solaris 10 (August 2011) on VM I am kind of new to Solaris.From VM workstation i allocated 35 GB to this Solaris VM's Disk The disk was named c1t0d0 Few basic slices for root(8gb), swap(517mb) and /export/home(494mb) were created by the solaris Installer during the... (18 Replies)
Discussion started by: polavan
18 Replies

9. Shell Programming and Scripting

I need help!! disk free space script

i want to write a shell script,when disk uses is 90% then automatically send a email to distribution list (group member)...... (1 Reply)
Discussion started by: sonu pandey
1 Replies

10. Solaris

Check free disk space in server

Hi, I need about 500G space in one corporate solaris server. However, I am not sure which command to use to check this. There are few volume groups in the server, and I deleted unused, old volume groups to clear some space. However, now I am not sure how to check the free space itself. ... (2 Replies)
Discussion started by: anaigini45
2 Replies
hx509 name functions(3) 					Heimdalx509library					   hx509 name functions(3)

NAME
hx509 name functions - Functions int hx509_name_to_string (const hx509_name name, char **str) int hx509_name_cmp (hx509_name n1, hx509_name n2) int hx509_parse_name (hx509_context context, const char *str, hx509_name *name) int hx509_name_copy (hx509_context context, const hx509_name from, hx509_name *to) int hx509_name_to_Name (const hx509_name from, Name *to) int hx509_name_expand (hx509_context context, hx509_name name, hx509_env env) void hx509_name_free (hx509_name *name) int hx509_unparse_der_name (const void *data, size_t length, char **str) int hx509_name_binary (const hx509_name name, heim_octet_string *os) int hx509_name_is_null_p (const hx509_name name) int hx509_general_name_unparse (GeneralName *name, char **str) Detailed Description See the PKIX/X.509 Names for description and examples. Function Documentation int hx509_general_name_unparse (GeneralName * name, char ** str) Unparse the hx509 name in name into a string. Parameters: name the name to print str an allocated string returns the name in string form Returns: An hx509 error code, see hx509_get_error_string(). int hx509_name_binary (const hx509_name name, heim_octet_string * os) Convert a hx509_name object to DER encoded name. Parameters: name name to concert os data to a DER encoded name, free the resulting octet string with hx509_xfree(os->data). Returns: An hx509 error code, see hx509_get_error_string(). int hx509_name_cmp (hx509_name n1, hx509_name n2) Compare to hx509 name object, useful for sorting. Parameters: n1 a hx509 name object. n2 a hx509 name object. Returns: 0 the objects are the same, returns > 0 is n2 is 'larger' then n2, < 0 if n1 is 'smaller' then n2. int hx509_name_copy (hx509_context context, const hx509_name from, hx509_name * to) Copy a hx509 name object. Parameters: context A hx509 cotext. from the name to copy from to the name to copy to Returns: An hx509 error code, see hx509_get_error_string(). int hx509_name_expand (hx509_context context, hx509_name name, hx509_env env) Expands variables in the name using env. Variables are on the form ${name}. Useful when dealing with certificate templates. Parameters: context A hx509 cotext. name the name to expand. env environment variable to expand. Returns: An hx509 error code, see hx509_get_error_string(). Only UTF8String rdnSequence names are allowed void hx509_name_free (hx509_name * name) Free a hx509 name object, upond return *name will be NULL. Parameters: name a hx509 name object to be freed. int hx509_name_is_null_p (const hx509_name name) Unparse the hx509 name in name into a string. Parameters: name the name to check if its empty/null. Returns: non zero if the name is empty/null. int hx509_name_to_Name (const hx509_name from, Name * to) Convert a hx509_name into a Name. Parameters: from the name to copy from to the name to copy to Returns: An hx509 error code, see hx509_get_error_string(). int hx509_name_to_string (const hx509_name name, char ** str) Convert the hx509 name object into a printable string. The resulting string should be freed with free(). Parameters: name name to print str the string to return Returns: An hx509 error code, see hx509_get_error_string(). int hx509_parse_name (hx509_context context, const char * str, hx509_name * name) Parse a string into a hx509 name object. Parameters: context A hx509 context. str a string to parse. name the resulting object, NULL in case of error. Returns: An hx509 error code, see hx509_get_error_string(). int hx509_unparse_der_name (const void * data, size_t length, char ** str) Convert a DER encoded name info a string. Parameters: data data to a DER/BER encoded name length length of data str the resulting string, is NULL on failure. Returns: An hx509 error code, see hx509_get_error_string(). Version 1.5.2 11 Jan 2012 hx509 name functions(3)
All times are GMT -4. The time now is 07:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy