Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Renaming a file



Hi,

I have following code to rename a file, but I always
get error -43(file not found), any help? Thanks,

	char *x = "/Users/justin/Movies/e1.mov";		 
	FSSpec fspc;
	path2fss(&fspc, x);
	err=FSpRename(&fspc,"/Users/justin/Movies/e1.movx");


//path2fss makes an FSSpec from a path with or without
a filename
int path2fss(FSSpec *fss, char *path)
{
  char buf[256];
  char *p = &buf[1];
  strcpy(p, path); //convert to Str255	
  buf[0] = strlen(p);
  return(FSMakeFSSpec(0, 0, (unsigned char *)buf,
fss)); //== noErr
}




	char *x = "/Users/justin/Movies/e1.mov";		 
	FSSpec fspc;
	path2fss(&fspc, CFStringGetCStringPtr(pathName,
nil));
	path2fss(&fspc, x);
	err=FSpRename(&fspc,"/Users/justin/Movies/e1.movx");



      現在你可輕易阻擋垃圾郵件,立即使用Yahoo! Mail你就會相信!


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.