Just answer the F*#king question

  • Home
  • About this site

Archive

Archive for March, 2009

Filesize fight

March 3rd, 2009 No comments

I dunno, I just like the way this fight was going.

FYI:

int getFileSizeFromPath(char * path)
{
FILE * file;
int fileSizeBytes = 0;
file = fopen(path,"r");
if(file>0){
fseek(file, 0, SEEK_END);
fileSizeBytes = ftell(file);
fseek(file, 0, SEEK_SET);
fclose(file);
}
return fileSizeBytes;
}

or in XCode use the NSFileManage:

NSFileManager * filemanager = [[NSFileManager alloc]init];
if([filemanager fileExistsAtPath:[self getCompletePath] isDirectory:&isDirectory]){

NSDictionary * attributes = [filemanager attributesOfItemAtPath:[self getCompletePath] error:nil];

// file size
NSNumber *theFileSize;
if (theFileSize = [attributes objectForKey:NSFileSize])_fileSize= [theFileSize intValue];
}

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Categories: Not answering the F*#king question Tags:
RSS feed

Random Posts

  • mySQL backup script
  • Acer EPowerManagement Issues
  • Notes on installing pgbouncer
  • Selecting random single row on large table
  • Windows Process Monitor

Tag Cloud

Categories

  • Cartoons
  • MySQL
  • Not answering the F*#king question
  • Postgresql
  • Sites of evil
  • Uncategorized
  • Useful stuff

Blogroll

  • Dinosaur comics
  • Ray Pecoskies tech blog

Archives

  • August 2010
  • July 2010
  • May 2010
  • April 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • July 2009
  • June 2009
  • April 2009
  • March 2009
  • February 2009
  • November 2008
  • October 2008
  • September 2008
  • July 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • October 2007
  • September 2007
  • August 2007
  • May 2007
  • April 2007

Meta

  • Log in
Top WordPress
Copyright © 2007-2010 Just answer the F*#king question
Theme by NeoEase. Valid XHTML 1.1 and CSS 3.