site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HFTF+PzOEYxuEp7nCjZryDkZLxJ/Fz028uLEa/GOuBc=; b=Sd6Cms0blRx36OSmGLhNfhSU9zNH+0fG5qnn0HesOKTqUmh3yf3DP6kj+baZfuyAh/ D5k1UJ+7scYFT10WhnmPzv35gqxxOqvG8zcs1EnX9XWeYXBg6qNyJK5KtzF6+2OROivk GWriKybwT+ViXimN6EFEcNaOACNuv/ZEsEnAA= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=BA7H79kR689keKhunoCjzKVx9KjPUyrbLBPXjHW5VJk2127I5aVkL9zlKs1C/q2awK rZgCyqPvBqRefBrsySuKbN273guJoVE9O2pwuy8maUH08ycJi/lh/RnkN8JsSxGdFmY4 SCm0K+oqQpRstjvqJOxCSJ5H53lzQQoQTZUQo= Hi, I created a file 1.alias (regular file) and surprisingly FSIsAliasFile() has recognized it as an alias file. This is such strange behavior. On Tue, Oct 20, 2009 at 5:04 PM, Paul M <list@no-tek.com> wrote:
I get the same results - FSIsAliasFile says it's an alias when it's just a regular file (so of course FSResolveAliasFile fails to resolve it).
It seems that all regular files that have an .alias extension are reported as an alias when clearly, they are not. You'll just have to take that into account in your code.
paulm
On 20/10/2009, at 11:50 PM, rohan a wrote:
Hi,
I get the same # file /usr/lib/charset.alias /usr/lib/charset.alias: ASCII text
But still FSIsAliasFile() identifies it as an alias.
On Tue, Oct 20, 2009 at 3:48 PM, Juan Manuel Palacios <jmpalaciosp@eml.cc> wrote:
On Oct 20, 2009, at 4:45 AM, rohan a wrote:
Hello All,
The file /usr/lib/charset.alias is identified by FSIsAliasFile() as an alias file. However, when I try to resolve it using FSResolveAliasFile() it fails to resolve.
$[jmpp @jmpp: ~](8/0,0) -> sw_vers ProductName: Mac OS X ProductVersion: 10.5.8 BuildVersion: 9L31a
$[jmpp @jmpp: ~](9/0,0) -> file /usr/lib/charset.alias /usr/lib/charset.alias: ASCII text
In my system that's a regular file, although I haven't tried FSIsAliasFile() on it to see what info I'd get. Have you checked manually at the terminal level? I would guess file(1) confirming it's not an alias would indeed have a lot of bearing on being able to resolve it.
Regards,...
- jmpp
Below is the code :
#include<stdio.h> #include "/Developer/Headers/FlatCarbon/Aliases.h"
int main(int argc,char *argv[]) { FSRef fileRef; Boolean aliasFileFlag, folderFlag,targetIsFolder,wasAliased; FSRef theRef; char path[255]; int i=0; int x;
FSPathMakeRef((UInt8 *)argv[1],&fileRef,NULL); FSPathMakeRef((UInt8 *)argv[1],&theRef,NULL); FSIsAliasFile(&fileRef, &aliasFileFlag, &folderFlag); if(aliasFileFlag == TRUE) printf("Alias file\n"); else { if(folderFlag == 1) printf("Folder\n"); else printf("File\n"); return 0; } x = FSResolveAliasFile(&theRef,TRUE,&targetIsFolder,&wasAliased); if (x) printf("failed\n");
if(targetIsFolder == TRUE) printf("Target is Directory\n"); else printf("Target is file\n");
FSRefMakePath(&theRef,path,255); printf("\"%s\" points to \"%s\"\n",argv[1],path); return 0; }
This code works for all other files.
What might be the issue ?
The output of GetFileInfo does not indicate that the file is an alias.
/Developer/Tools/GetFileInfo /usr/lib/charset.alias file: "/usr/lib/charset.alias" type: "" creator: "" attributes: avbstclinmedz created: 04/01/1976 15:30:38 modified: 01/30/2006 13:41:33
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com