summaryrefslogtreecommitdiff
path: root/firmware/common/file.c
AgeCommit message (Collapse)Author
2011-06-20Dircache: Don't expose struct dircache_entry and pointers into the cache, ↵Thomas Martitz
use IDs instead. Only integer IDs are exposed from dircache with this. This way the cache is isolated from other modules. This is needed for my buflib gsoc project. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30038 a1c6a512-1295-4272-9138-f99709370657
2011-02-27Fix yellowMichael Sparmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29449 a1c6a512-1295-4272-9138-f99709370657
2011-02-27iPod Classic CE-ATA Support (Part 3 of 4: Introduce STORAGE_NEEDS_ALIGN, ↵Michael Sparmann
which ensures that no unaligned storage accesses are performed through file.c) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29447 a1c6a512-1295-4272-9138-f99709370657
2011-02-27iPod Classic CE-ATA Support (Part 1 of 4: Cacheline align some statically ↵Michael Sparmann
allocated sector buffers) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29444 a1c6a512-1295-4272-9138-f99709370657
2010-11-28Accept FS#11774 by Michael Hohmuth (with some own modifications to #ifdef ↵Frank Gevaerts
conditions) Unmount all filesystems before connecting USB. This ensures that all filehandles are closed, which avoids possible filesystem corruption git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28693 a1c6a512-1295-4272-9138-f99709370657
2010-10-25Fix screendump on iPod Nano 2G by increasing the usb thread stack size and ↵Michael Sparmann
reducing the stack usage of FAT and storage functions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28356 a1c6a512-1295-4272-9138-f99709370657
2010-09-01Ged rid of uisimulator/common/io.c for android builds.Thomas Martitz
Use host's functions for file i/o directly (open(), close() ,etc.), not the sim_* variants. Some dir functions need to be wrapped still because we need to cache the parents dir's path (host's dirent doesn't let us know). For the same reason (incompatibility) with host's dirent) detach some members from Rockbox' dirent struct and put it into an extra one, the values can be retrieved via the new dir_get_info(). Get rid of the sim_ prefix for sleep as well and change the signature to unix sleep(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27968 a1c6a512-1295-4272-9138-f99709370657
2010-05-20disk/file: Do not use & on arraysRafaël Carré
it might be valid C but is confusing, and not consistent with the rest of file.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26191 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make open() posix compliant api-wise. A few calls (those with O_CREAT) need ↵Thomas Martitz
the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make creat() posix compliant API-wise. Shouldn't affect the core as it's ↵Thomas Martitz
wrapped via a static inline. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
2010-01-01FS#9409: fix rename which didn't close file handles on error and enventually ↵Amaury Pouly
cause cut/paste to fail between volumes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24134 a1c6a512-1295-4272-9138-f99709370657
2009-12-23Make read() and write() return -1/EISDIR on directoriesFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24106 a1c6a512-1295-4272-9138-f99709370657
2009-12-23only get the file pointer if fd is actually valid.Frank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24105 a1c6a512-1295-4272-9138-f99709370657
2009-11-26Move strip_volume() to filefuncs.c and set properties.Maurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23767 a1c6a512-1295-4272-9138-f99709370657
2009-11-26 - Split off strip_volume() to a separate fileMaurus Cuelenaere
- fix some yellows git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23762 a1c6a512-1295-4272-9138-f99709370657
2009-11-26Merge branch 'hotswap'Maurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23759 a1c6a512-1295-4272-9138-f99709370657
2009-07-14FS#10080Nils Wallménius
* Move strncpy() from core to the pluginlib * Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins * Drop strncpy() from the codec api as no codec used it * Bump codec and plugin api versions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-05-05Convert the whole codebase to UTF-8, except docs/COMMITTERS and ↵Nicolas Pennequin
tools/creative.c, which need checking. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17369 a1c6a512-1295-4272-9138-f99709370657
2008-03-11Committed the missing file to r16632.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16634 a1c6a512-1295-4272-9138-f99709370657
2008-02-07Let the FAT namecheck also look for trailing spaces, fixes FS #8560.Peter D'Hoye
Only call the dircache rename function if the actual rename was ok. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16241 a1c6a512-1295-4272-9138-f99709370657
2007-12-13Another fix for file system issues when encountering disk full (like when ↵Peter D'Hoye
recording) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15920 a1c6a512-1295-4272-9138-f99709370657
2007-10-29More code police...Peter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15353 a1c6a512-1295-4272-9138-f99709370657
2007-10-10Fix FS #5852 by trying to properly close and update the recorded file, and ↵Peter D'Hoye
give the FAT the correct file info. Add filehandle checks to some file functions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15072 a1c6a512-1295-4272-9138-f99709370657
2007-09-02Fix FS#7679 - modifying files with dircahce enabled doesnt change the access ↵Jonathan Gordon
time/date in dircache git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14580 a1c6a512-1295-4272-9138-f99709370657
2007-07-20Makes apps and plugins interract with directories using a posix-like api ↵Kevin Ferrare
instead of calling dircache / simulator functions (no additionnal layer added, only a cosmetic change) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13943 a1c6a512-1295-4272-9138-f99709370657
2007-04-26avoid declaring shadow 'rc' variables (-Wshadow!)Daniel Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13270 a1c6a512-1295-4272-9138-f99709370657
2007-02-01Removed 'mode' parameter from creat(). It wasn't pure posix anyway, it was ↵Jens Arnold
ignored on target and mixed into 'oflags' in the simulator. * Simplified io.c a bit by defining a dummy O_BINARY for OSes which don't have that. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12179 a1c6a512-1295-4272-9138-f99709370657
2006-12-04Much simpler implementation of large virtual sector support, not needing ↵Jens Arnold
larger sector buffers and not touching file.c at all. secmult is simply used to normalize all sector counts to 512-byte physical sectors. * Moved MAX_SECTOR_SIZE definition to config-*.h, and enabled it for iPod Video only. MAX_SECTOR_SIZE now only enables checking for alternate disk layouts due to sector size (as iPod Video G5.5 is presented as having 2048-byte _physical_ sectors to the PC). Large virtual sector support in fat.c is always enabled. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11659 a1c6a512-1295-4272-9138-f99709370657
2006-12-03Add support (runtime detection) for 2048 bytes/sector filesystem.Miika Pekkarinen
Large sectors are enabled for iPod Video (including 5.5G) only. Might still cause FS corruption (however, unlikely), so beware! Based on FS#6169 by Robert Carboneau. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11651 a1c6a512-1295-4272-9138-f99709370657
2006-05-16Update dircache startcluster at file close when writing. Fixes bug when ↵Hardeep Sidhu
creating small files (dircache startcluster remains 0 because fat write doesn't occur until close). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9950 a1c6a512-1295-4272-9138-f99709370657
2006-04-13Fixed the file renaming/removing issue with dircache enabled.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9649 a1c6a512-1295-4272-9138-f99709370657
2006-03-30Do the dircache operation first to block properly when necessary.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9356 a1c6a512-1295-4272-9138-f99709370657
2006-03-28Boost open() performance on platforms with dircache. Tagcache initialMiika Pekkarinen
scanning now over 50% faster than before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9306 a1c6a512-1295-4272-9138-f99709370657
2006-03-02TAB policed.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8887 a1c6a512-1295-4272-9138-f99709370657
2006-03-02Change rename() to set errno to EXDEV if a rename is attempted across volumes.Dan Everton
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8883 a1c6a512-1295-4272-9138-f99709370657
2005-12-17More compact & straight-forward headbytes handling.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8255 a1c6a512-1295-4272-9138-f99709370657
2005-12-16Now the file corruption bug when reading & writing the same file isMiika Pekkarinen
hopefully fully fixed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8251 a1c6a512-1295-4272-9138-f99709370657
2005-12-13Fixed a file system driver caching bug corrupting files on certain situationsMiika Pekkarinen
(when reading and writing the same file). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8231 a1c6a512-1295-4272-9138-f99709370657
2005-10-07Implemented directory caching. No more waiting for disk to spin up whileMiika Pekkarinen
browsing when cache is enabled (system -> disk -> enable directory cache). Cache building on boot is transparent except the first boot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7588 a1c6a512-1295-4272-9138-f99709370657
2005-01-28preparations for hotswapping MMCJörg Hohensohn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5701 a1c6a512-1295-4272-9138-f99709370657
2005-01-23int -> long where neededJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5643 a1c6a512-1295-4272-9138-f99709370657
2004-12-28prepared to mount multiple partitions into one logical file system (most ↵Jörg Hohensohn
useful for Ondio, internal memory + external MMC) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5514 a1c6a512-1295-4272-9138-f99709370657
2004-11-17Bug fix: Do only flush the sector buffer after writing head bytes if it ↵Jens Arnold
really needs to be. The old code did flush always, causing the huge slowdown of fprintf() and other places writing byte-wise git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5413 a1c6a512-1295-4272-9138-f99709370657
2004-10-01void* can't be offset, gcc should not allows thisJörg Hohensohn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5147 a1c6a512-1295-4272-9138-f99709370657
2004-09-06Bug fix: open() now handles O_TRUNC correctly (this was the real cause for ↵Jens Arnold
the .playlist_control corruption) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5048 a1c6a512-1295-4272-9138-f99709370657
2004-08-22Bug fix: renaming a directory could cause a name clash. New feature: ↵Linus Nielsen Feltzing
rename() can now move files/directories as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5008 a1c6a512-1295-4272-9138-f99709370657
2004-07-19The pathname argument for open() is declared const, so copy it has to be copiedJens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4894 a1c6a512-1295-4272-9138-f99709370657
2004-04-16No need to call fat_truncate() to delete the file, fat_remove() frees all ↵Linus Nielsen Feltzing
clusters anyway git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4508 a1c6a512-1295-4272-9138-f99709370657
2004-03-10You can't open() a directory as a file (at least not for writing)Linus Nielsen Feltzing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4359 a1c6a512-1295-4272-9138-f99709370657