On Mon, Jul 31, 2006, Bob Copeland wrote:
> > Agreed, although there are some small things that need changing first.
> > I will implement authenticate() and request/release_io_lock() as no-ops
> > in karmaUsb this evening. That will finish off all the items on the
> > TODO list.
It seems that these were already done so I've just removed them from
TODO and updated some of the comments.
The patch also fixes a small bug I've noticed. It would appear that the
karma doesn't always remove a file from the hard disk when you ask it
to and only removes it from the list.
This patch ensures that it gets removed from the hard drive aswell.
Keith.
# HG changeset patch
# User Keith Bennett <[EMAIL PROTECTED]>
# Node ID 204512cea07a952e6489c97763bb15d374d235db
# Parent a9358ec4ec437360cbb426e2ca775b118998f767
Ensure that files marked as deleted in smalldb are also deleted
on the karma.
Remove last entry from the TODO list.
diff -r a9358ec4ec43 -r 204512cea07a TODO
--- a/TODO Mon Jul 31 09:14:27 2006
+++ b/TODO Mon Jul 31 18:42:17 2006
@@ -1,6 +1,3 @@
-TODO
-- lkarmaUsb: Implement hangup(), authenticate(), request/release_io_lock() ?
-
DONE
- lkarmaUsb: Manage the "smalldb" in addition to the fids?/_000??/??1 files
- lkarmaUsb: Check correctness of get_storage_details()
diff -r a9358ec4ec43 -r 204512cea07a src/karmaUsb.c
--- a/src/karmaUsb.c Mon Jul 31 09:14:27 2006
+++ b/src/karmaUsb.c Mon Jul 31 18:42:17 2006
@@ -92,7 +92,6 @@
/* --------------------------------------------------------------------------
*/
uint32_t lk_karmaUsb_authenticate(int rio, char *pass)
{
-/* *************** Implement some permission checking here ?? ***************
*/
return 0;
}
@@ -175,13 +174,13 @@
/* --------------------------------------------------------------------------
*/
int32_t lk_karmaUsb_request_io_lock(int rio, uint32_t type)
{
-/* ****************************** UNNEEDED ??? ******************************
*/
+/* ****************************** UNNEEDED **********************************
*/
return 0;
}
int32_t lk_karmaUsb_release_io_lock(int rio)
{
-/* ****************************** UNNEEDED ??? ******************************
*/
+/* ****************************** UNNEEDED **********************************
*/
return 0;
}
@@ -443,7 +442,7 @@
return -1;
}
while((de0 = readdir(dp0)) != NULL) {
- if(strncmp(de0->d_name, "_00", 3) != 0)
+ if(strncmp(de0->d_name, "_0", 2) != 0)
continue;
strcpy(path, path1);
strcat(path, de0->d_name);
@@ -587,6 +586,15 @@
fprintf(stderr, "scan_playlist: error allocating memory\n");
}
+static void delete_file(char *props)
+{
+ unsigned int fid;
+
+ /* The first entry is always the fid */
+ fid = atoi(&props[4]);
+ unlink(fidToPath(0, fid));
+}
+
static int32_t read_properties_smalldb(char **properties)
{
/* parse smalldb for all properties */
@@ -711,6 +719,7 @@
for (j = 0; j < db->num_playlists; j++)
if(db->playlists[j].index == i)
goto outer;
+ delete_file(prop_strs[i]);
continue;
}
outer:
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-karma-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-karma-devel