• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Rename files containing a slash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rename files containing a slash


  • Subject: Re: Rename files containing a slash
  • From: Pierre-Olivier Latour <email@hidden>
  • Date: Mon, 21 Oct 2002 15:15:32 -0700

> Hi,
> I'm trying to rename a file using a new filename containing a slash.
> Since I can't find a Cocoa API that renames files I use the Carbon API:
> err = FSRenameUnicode(&destRef, nameLength, name, theInfo.textEncodingHint,
> nil);
>
> Each time the fileName proposed contains a slash (that Finder accepts) this
> API returns an error. Please may someone help me to fix the trouble?
> Thank you.

Try replacing the '/' character with a ':'.

Carbon does not allow ':' in a file name because it's the path separator,
but does allow '/'. It's the reverse for Cocoa.

Using this tip I was able to rename file with '/' character in their name
through the UNIX rename() function.

_____________________________________________________________

Pierre-Olivier Latour email@hidden
Lausanne, Switzerland http://www.pol-online.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Rename files containing a slash (From: Lorenzo Puleo <email@hidden>)

  • Prev by Date: Re: Linking to Carbonized Shared Library
  • Next by Date: Re: Finder contextual menu item?
  • Previous by thread: Re: Rename files containing a slash
  • Next by thread: Re: Rename files containing a slash
  • Index(es):
    • Date
    • Thread