Exemplo n.º 1
0
/*
** fr_delete
**
** Delete a file. Removes the chain that belongs to the file and inserts a new descriptor
** to the directory with first_cluster set to 0.
**
** INPUT : filename - name of the file to delete
** RETURN: F_NOERR on success, other if error.
*/
unsigned char fr_delete ( const char * filename )
{
  unsigned char  rc;

  if( xSemaphoreTake( fs_lock_semaphore, F_MAX_LOCK_WAIT_TICKS ) == pdPASS )
  {
    rc = fn_delete( filename );
    xSemaphoreGive( fs_lock_semaphore );
  }
  else
  {
    rc = F_ERR_OS;
  }

  return rc;
}
Exemplo n.º 2
0
Arquivo: quotes.c Projeto: nsavry/42sh
char		*ft_quote(char *line)
{
	char		*str;

	str = NULL;
	line = delete_spaces(line);
	if (line[ft_strlen(line) - 1] == '\\' &&
			((((int)ft_strlen(line) - 2) >= 0 &&
				line[ft_strlen(line) - 2] != '\\') || (ft_strlen(line) == 1)))
	{
		while (line[ft_strlen(line) - 1] == '\\' && ((ft_strlen(line) == 1) ||
						(((int)ft_strlen(line) - 2) >= 0 &&
									line[ft_strlen(line) - 2] != '\\')))
		{
			line = fn_delete(line, ft_strlen(line) - 1);
			str = ft_termcaps(ft_printf("> "));
			line = ft_strjoin(line, str);
		}
	}
	if (ft_strchr(line, '"') || ft_strchr(line, '\'') || ft_strchr(line, '`'))
		line = the_quotes(line);
	line = ft_parentheses(line, str);
	return (line);
}