SmartFolder  1.0
SmartFolder is a way to search files on your system and group the results. The program will interpret search queries and create a folder with symbolic links to all the found matches.
Linker.h File Reference

Header file that contains the definitions for the functions that will take care of the SmartFolder creation as well as the link creation. More...

#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include "Syscall.h"
#include "Logger.h"
#include "List.h"
Include dependency graph for Linker.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int makeLink (char *pathToLink, char *destFolder)
 
int removeLink (char *pathOfFile, char *linkFolder)
 
void nextSuffix (char *name)
 
int makeFolder (char *path, List *files)
 
int removeFolder (char *path)
 

Detailed Description

Header file that contains the definitions for the functions that will take care of the SmartFolder creation as well as the link creation.

Authors
Maxime Lovino, Thomas Ibanez
Date
January 25, 2017
Version
1.0

Function Documentation

int makeFolder ( char *  path,
List files 
)

Function that creates the SmartFolder and links for all files in the list

Parameters
pathThe path of the SmartFolder
filesA list of files to link
Returns
-1 on error, 1 if exists already, 0 otherwise
int makeLink ( char *  pathToLink,
char *  destFolder 
)

Function that creates a link for the file and puts the link in the destination folder

Parameters
pathToLinkThe path we want to link to
destFolderThe destination folder for the link
Returns
1 on succes, 0 otherwise
void nextSuffix ( char *  name)

Function to add the next suffix to a name (if no suffix, it will add (1), otherwise it will just increment the count)

Parameters
nameThe current name of the file
int removeFolder ( char *  path)

Function that deletes a folder and all its content

Parameters
pathThe path of the folder to delete
Returns
1 on success, 0 otherwise
int removeLink ( char *  pathOfFile,
char *  linkFolder 
)

Function to remove a link

Parameters
pathOfFileThe path of the file linked by the link we want to remove
linkFolderThe folder where the links are stored
Returns
1 on success, 0 otherwise