// ---------------------------------------------------------------------------
// CExcludeListEntry::ConstructL
// ---------------------------------------------------------------------------
//
void CExcludeListEntry::ConstructL( const TDesC& aPath )
    {
    FUNC_LOG;

    iFolderLevel = FolderLevel( aPath );
    iPath = aPath.AllocL();
    iType = EPreserve; // Default
    if ( ContainsWildCards( aPath ) )
        {
        if ( ContainsSingleWildCardEnding( aPath ) )
            {
            // Wild card match all
            iType = EPreserveAll;
            }
        else
            {
            // Wild card pattern match
            iType = EPreserveMatching;
            }
        }

    INFO_2( "Exclude path: '%S', type %d", iPath, iType );
    }
Example #2
0
File: MOVE.C Project: FDOS/move
static void move_files(const char *src_pathname, const char *src_filename,
                       const char *dest_pathname, const char *dest_filename,
                       int movedirs)
{
    char filepattern[MAXPATH],src_path_filename[MAXPATH],dest_path_filename[MAXPATH];
    char tmp_filename[MAXFILE+MAXEXT],tmp_pathname[MAXPATH];
    struct ffblk fileblock;
    int fileattrib, done;

    fileattrib=FA_RDONLY+FA_ARCH+FA_SYSTEM;

    if (movedirs || !ContainsWildCards(src_filename))
       fileattrib +=FA_DIREC;

    /* Find first source file. */
    strmcpy(filepattern, src_pathname, sizeof(filepattern));
    strmcat(filepattern, src_filename, sizeof(filepattern));
    done=findfirst(filepattern, &fileblock, fileattrib);
    while ((!done) && (fileblock.ff_name[0] == '.'))
	   done = findnext(&fileblock);

    if (done)
    {
       char buffer[80];
#ifdef USE_KITTEN
       sprintf(buffer, "%s%s %s", src_pathname, src_filename, kittengets(1,0,"does not exist!"));
#else
       sprintf(buffer, "%s%s does not exist!", src_pathname, src_filename);
#endif
       /* error */
       fprintf(stderr, " [%s]\n", buffer);
    }

    /* Check if destination directory has to be created. */
    if ((!done) && !dir_exists(dest_pathname))
    {
        strmcpy(tmp_pathname, dest_pathname, sizeof(tmp_pathname));
        if (makedir(tmp_pathname) != 0)
	{
#ifdef USE_KITTEN
	    error(1,10,"Unable to create directory");
	    kittenclose();
#else
	    error("Unable to create directory");
#endif
	    exit(4);
        } /* end if. */

    } /* end if. */

    /* Copy files. */
    while (!done)
    {
        /* Build source filename including path. */
        strmcpy(src_path_filename, src_pathname, sizeof(src_path_filename));
        strmcat(src_path_filename, fileblock.ff_name,
	        sizeof(src_path_filename));

        /* Build destination filename including path. */
        strmcpy(dest_path_filename, dest_pathname, sizeof(dest_path_filename));
        build_filename(tmp_filename, fileblock.ff_name, dest_filename);
        strmcat(dest_path_filename, tmp_filename, sizeof(dest_path_filename));
        prepare_move(src_path_filename, dest_path_filename);

	do {
	  done = findnext(&fileblock);
	} while ((!done) && (fileblock.ff_name[0] == '.'));
    } /* end while. */

} /* end move_files. */