Artifacts Associated With Ticket 218946
Ticket change [5e4b838b60] (rid 115612) by nobody on 2000-10-26 01:08:28:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 2869 Bug Version: 8.2 SubmitDate: '1999-09-23' LastModified: '1999-09-24' Severity: SER Status: Released Submitter: techsupp ChangedBy: hobbs OS: Macintosh OSVersion: 8.6 Machine: Power PC FixedDate: '1999-09-24' FixedInVersion: 8.2.1 ClosedDate: '2000-10-25' Name: vince darley ReproducibleScript: Any use of file attributes with a filename which contains chars > 128 will fail since the file can't be found. This is because Tcl doesn't convert the name from UTF to native. Patch: *** tcl8.2/mac/tclMacFCmd.cWed Sep 22 12:51:48 1999 --- tcl8.2orig/mac/tclMacFCmd.cTue May 11 01:12:00 1999 *************** *** 1194,1210 **** GetFileFinderAttributes( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute option. */ ! CONST char *fileName,/* The name of the file (UTF-8). */ Tcl_Obj **attributePtrPtr)/* A pointer to return the object with. */ { OSErr err; FSSpec fileSpec; FInfo finfo; ! Tcl_DString pathString; ! ! Tcl_UtfToExternalDString(NULL, path, -1, &pathString); ! err = FSpLocationFromPath(Tcl_DStringLength(&pathString), Tcl_DStringValue(&pathString), &fileSpec); ! Tcl_DStringFree(&pathString); if (err == noErr) { err = FSpGetFInfo(&fileSpec, &finfo); --- 1194,1207 ---- GetFileFinderAttributes( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute option. */ ! CONST char *fileName,/* The name of the file. */ Tcl_Obj **attributePtrPtr)/* A pointer to return the object with. */ { OSErr err; FSSpec fileSpec; FInfo finfo; ! ! err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); if (err == noErr) { err = FSpGetFInfo(&fileSpec, &finfo); *************** *** 1272,1288 **** GetFileReadOnly( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute. */ ! CONST char *fileName,/* The name of the file (UTF-8). */ Tcl_Obj **readOnlyPtrPtr)/* A pointer to return the object with. */ { OSErr err; FSSpec fileSpec; CInfoPBRec paramBlock; ! Tcl_DString pathString; ! ! Tcl_UtfToExternalDString(NULL, path, -1, &pathString); ! err = FSpLocationFromPath(Tcl_DStringLength(&pathString), Tcl_DStringValue(&pathString), &fileSpec); ! Tcl_DStringFree(&pathString); if (err == noErr) { if (err == noErr) { --- 1269,1282 ---- GetFileReadOnly( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute. */ ! CONST char *fileName,/* The name of the file. */ Tcl_Obj **readOnlyPtrPtr)/* A pointer to return the object with. */ { OSErr err; FSSpec fileSpec; CInfoPBRec paramBlock; ! ! err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); if (err == noErr) { if (err == noErr) { *************** *** 1336,1352 **** SetFileFinderAttributes( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute. */ ! CONST char *fileName,/* The name of the file (UTF-8). */ Tcl_Obj *attributePtr)/* The command line object. */ { OSErr err; FSSpec fileSpec; FInfo finfo; ! Tcl_DString pathString; ! ! Tcl_UtfToExternalDString(NULL, path, -1, &pathString); ! err = FSpLocationFromPath(Tcl_DStringLength(&pathString), Tcl_DStringValue(&pathString), &fileSpec); ! Tcl_DStringFree(&pathString); if (err == noErr) { err = FSpGetFInfo(&fileSpec, &finfo); --- 1330,1343 ---- SetFileFinderAttributes( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute. */ ! CONST char *fileName,/* The name of the file. */ Tcl_Obj *attributePtr)/* The command line object. */ { OSErr err; FSSpec fileSpec; FInfo finfo; ! ! err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); if (err == noErr) { err = FSpGetFInfo(&fileSpec, &finfo); *************** *** 1427,1444 **** SetFileReadOnly( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute. */ ! CONST char *fileName,/* The name of the file (UTF-8). */ Tcl_Obj *readOnlyPtr)/* The command line object. */ { OSErr err; FSSpec fileSpec; HParamBlockRec paramBlock; int hidden; ! Tcl_DString pathString; ! ! Tcl_UtfToExternalDString(NULL, path, -1, &pathString); ! err = FSpLocationFromPath(Tcl_DStringLength(&pathString), Tcl_DStringValue(&pathString), &fileSpec); ! Tcl_DStringFree(&pathString); if (err == noErr) { if (Tcl_GetBooleanFromObj(interp, readOnlyPtr, &hidden) != TCL_OK) { --- 1418,1432 ---- SetFileReadOnly( Tcl_Interp *interp,/* The interp to report errors with. */ int objIndex,/* The index of the attribute. */ ! CONST char *fileName,/* The name of the file. */ Tcl_Obj *readOnlyPtr)/* The command line object. */ { OSErr err; FSSpec fileSpec; HParamBlockRec paramBlock; int hidden; ! ! err = FSpLocationFromPath(strlen(fileName), fileName, &fileSpec); if (err == noErr) { if (Tcl_GetBooleanFromObj(interp, readOnlyPtr, &hidden) != TCL_OK) { PatchFiles: tclMacFCmd.c Fix applied to 8.2.1. -- 09/24/1999 hobbs - foundin initialized to: "obsolete: 8.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to:
file attributes on MacOS doesn't do UTF->External conversion
- type initialized to: "Bug"
Ticket change [72e52308e0] (rid 104947) by welch on 2000-10-26 08:32:14:
- closedate changed to: "2000-10-26T01:32:14"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [59e7916dd5] (rid 118047) by dgp on 2001-04-19 03:32:02:
- closedate changed to: "2001-04-18T20:32:02"
- closer changed to: "dgp"
- subsystem changed to: "37. File System"