Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5e4b838b60041b97d96e9dc501aa1de9433d35e7
Ticket: 218946ffffffffffffffffffffffffffffffffff
file attributes on MacOS doesn't do UTF->External conversion
User & Date: nobody on 2000-10-26 01:08:28
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed 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
    
  4. foundin changed to: "obsolete: 8.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    file attributes on MacOS doesn't do UTF->External conversion
    
  11. type changed to: "Bug"