[Tfug] How do you remove a file from a USB vfat - in c
Nate
nate at seekio.com
Thu Nov 8 12:26:07 MST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Try unlink() in unistd.h
http://bama.ua.edu/cgi-bin/man-cgi?unlink+2
Nate
jblais wrote:
> Hello
>
> this is another of my dumb questions
>
> I'm trying to use a USB sick with vfat -- sorry, it has to be seen
> eventually by winders.
>
> The issue is this. In C I just do remove("filename"); and for Linux (ext2
> ?) the file length is set to 0, and the OS does the rest. For the vfat
> partition, just setting the length to 0 doesn't do the trick. Initially the
> file "looks" to have been removed, but when I re-mount the USB stick, it's
> there as a 0 length file, which can get copied to my local Linux drive, and
> from there I need to deal with the ugliness that's it's 0 length. I guess I
> could add a bunch of checks for 0 length in everything, like listing folder
> contents, selecting files, opening files, deleting files.. But eventually I
> do need to literally remove the file...
>
> I did a google thing, and got mostly a bunch of command line stuff, which
> may work, but I'd like to know how to do it from c --
>
> Anyway - thanks for any help..
>
> Joe
>
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
- --
Nate
System Admin Manager
System Administration
Ext 220
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHM2LORMRYK1K/wKQRAnpzAKCnoNq8duyRpaKpGAG76gcGXTP3lACbBpJs
2hOGd4x0ZteoeC8+ED62cN0=
=cUQg
-----END PGP SIGNATURE-----
More information about the tfug
mailing list