2 * COPYRIGHT: See COPYING in the top level directory
3 * PROGRAMMER: Rex Jolliff (rex@lvcablemodem.com)
4 * PURPOSE: Platform independant delete command
15 convertPath (char * pathToConvert
)
17 while (*pathToConvert
!= 0)
19 if (*pathToConvert
== '\\')
28 getDirectory (const char *filename
, char * directorySpec
)
30 int lengthOfDirectory
;
32 if (strrchr (filename
, '/') != 0)
34 lengthOfDirectory
= strrchr (filename
, '/') - filename
;
35 strncpy (directorySpec
, filename
, lengthOfDirectory
);
36 directorySpec
[lengthOfDirectory
] = '\0';
40 strcpy (directorySpec
, ".");
45 getFilename (const char *filename
, char * fileSpec
)
47 if (strrchr (filename
, '/') != 0)
49 strcpy (fileSpec
, strrchr (filename
, '/') + 1);
53 strcpy (fileSpec
, filename
);
58 main (int argc
, char* argv
[])
64 for (idx
= 1; idx
< argc
; idx
++)
66 convertPath (argv
[idx
]);
70 printf ("delete %s\n", argv
[idx
]);
74 returnCode
= remove (argv
[idx
]);
75 if (returnCode
!= 0 && errno
!= ENOENT
)
77 /* Continue even if there is errors */
79 printf ("Unlink of %s failed. Unlink returned %d.\n",