Example #1
0
void
SynchronizeLFNs (void)
{
  int i;

  for (i = 0; i < MAXSFNS; i++)
    {
      if ((LongNames[i] != '\0') && (ShortNames[i] != '\0') &&
	  (IsLFNSupported (LongNames[i]) == TRUE))
	{
	  lfn2sfn95 (LongNames[i], scratchpad);

	  if ((strcmpi (ShortNames[i], scratchpad) != 0) &&
	      (Attributes[i].output))
	    {
	      if (!rename95 (ShortNames[i], LongNames[i]))
		{
		  rename (ShortNames[i], LongNames[i]);
		  strcpy (ShortNames[i], LongNames[i]);
		}
	      else
		lfn2sfn95 (LongNames[i], ShortNames[i]);
	    }
	}
    }
}
Example #2
0
int LFNFirstFile(char* wildcard, char* file, char* longfile)
{
    int retVal;

    if (IsLFNSupported(wildcard))
    {  
        lfnSupported = 1;

        retVal = findfirst95(wildcard, &ff95, 0);

        if (retVal == 0)
        {
            strcpy(file, ff95.ff_95.ff_shortname);
            strcpy(longfile, ff95.ff_95.ff_longname);
        }
    
        return retVal;
    }
    else
    {
        lfnSupported = 0;

        retVal = findfirst(wildcard, &ff, 0);

        if (retVal == 0)
        {
            strcpy(file, ff.ff_name);
            strcpy(longfile, ff.ff_name);
        }
    
        return retVal;
    }
}
Example #3
0
int LFNConvertToSFN(char* file)
{
    static char buffer[67];

    if (IsLFNSupported(file))
    {
        if (lfn2sfn95(file, buffer) == 0)
        {
            strcpy(file, buffer);
            return 1;
        }
        else
            return 0;
    }

    return 1;
}
Example #4
0
void
ConvertToSFN (char *lfn, int index)
{
  int supported;
  ShortNames[index][0] = '\0';	/* important */

  supported = IsLFNSupported (lfn);

  if (supported == TRUE)
    {
      if (lfn2sfn95 (lfn, ShortNames[index]) != 0)
	ShortNames[index][0] = '\0';
    }
  else if (supported == MAYBE)
    ShortNames[index][0] = '\0';	/* Don't know wether LFN is supported. */
  else
    strcpy (ShortNames[index], lfn);

  strcpy (LongNames[index], lfn);
}
Example #5
0
char *
GetSFN (int index)
{
  int supported;

  if (ShortNames[index][0] == 0)
    {
      /* At this time the disk has to be in the station */
      supported = IsLFNSupported (LongNames[index]);
      if (supported == TRUE)
	{
	  if (LongNames[index][0] != 0)
	    GenerateUniqueSFN (LongNames[index], ShortNames[index]);
	  else
	    return NULL;
	}
      else if (supported == MAYBE)
	return NULL;		/* Disk not in drive */
      else
	strcpy (ShortNames[index], LongNames[index]);	/* LFN not supported after all. */
    }

  return ShortNames[index];
}