summaryrefslogtreecommitdiff
path: root/firmware/common/file.c (follow)
Commit message (Collapse)AuthorAge
* Dircache: Don't expose struct dircache_entry and pointers into the cache, ↵Thomas Martitz2011-06-20
| | | | | | | | | 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
* Fix yellowMichael Sparmann2011-02-27
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29449 a1c6a512-1295-4272-9138-f99709370657
* iPod Classic CE-ATA Support (Part 3 of 4: Introduce STORAGE_NEEDS_ALIGN, ↵Michael Sparmann2011-02-27
| | | | | | 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
* iPod Classic CE-ATA Support (Part 1 of 4: Cacheline align some statically ↵Michael Sparmann2011-02-27
| | | | | | allocated sector buffers) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29444 a1c6a512-1295-4272-9138-f99709370657
* Accept FS#11774 by Michael Hohmuth (with some own modifications to #ifdef ↵Frank Gevaerts2010-11-28
| | | | | | | | | | 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
* Fix screendump on iPod Nano 2G by increasing the usb thread stack size and ↵Michael Sparmann2010-10-25
| | | | | | reducing the stack usage of FAT and storage functions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28356 a1c6a512-1295-4272-9138-f99709370657
* Ged rid of uisimulator/common/io.c for android builds.Thomas Martitz2010-09-01
| | | | | | | | | | | 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
* disk/file: Do not use & on arraysRafaël Carré2010-05-20
| | | | | | 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
* Make open() posix compliant api-wise. A few calls (those with O_CREAT) need ↵Thomas Martitz2010-05-06
| | | | | | 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
* Make creat() posix compliant API-wise. Shouldn't affect the core as it's ↵Thomas Martitz2010-05-06
| | | | | | wrapped via a static inline. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
* FS#9409: fix rename which didn't close file handles on error and enventually ↵Amaury Pouly2010-01-01
| | | | | | cause cut/paste to fail between volumes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24134 a1c6a512-1295-4272-9138-f99709370657
* Make read() and write() return -1/EISDIR on directoriesFrank Gevaerts2009-12-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24106 a1c6a512-1295-4272-9138-f99709370657
* only get the file pointer if fd is actually valid.Frank Gevaerts2009-12-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24105 a1c6a512-1295-4272-9138-f99709370657
* Move strip_volume() to filefuncs.c and set properties.Maurus Cuelenaere2009-11-26
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23767 a1c6a512-1295-4272-9138-f99709370657
* - Split off strip_volume() to a separate fileMaurus Cuelenaere2009-11-26
| | | | | | - fix some yellows git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23762 a1c6a512-1295-4272-9138-f99709370657
* Merge branch 'hotswap'Maurus Cuelenaere2009-11-26
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23759 a1c6a512-1295-4272-9138-f99709370657
* FS#10080Nils Wallménius2009-07-14
| | | | | | | | | | * 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
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | 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
* Convert the whole codebase to UTF-8, except docs/COMMITTERS and ↵Nicolas Pennequin2008-05-05
| | | | | | tools/creative.c, which need checking. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17369 a1c6a512-1295-4272-9138-f99709370657
* Committed the missing file to r16632.Miika Pekkarinen2008-03-11
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16634 a1c6a512-1295-4272-9138-f99709370657
* Let the FAT namecheck also look for trailing spaces, fixes FS #8560.Peter D'Hoye2008-02-07
| | | | | | 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
* Another fix for file system issues when encountering disk full (like when ↵Peter D'Hoye2007-12-13
| | | | | | recording) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15920 a1c6a512-1295-4272-9138-f99709370657
* More code police...Peter D'Hoye2007-10-29
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15353 a1c6a512-1295-4272-9138-f99709370657
* Fix FS #5852 by trying to properly close and update the recorded file, and ↵Peter D'Hoye2007-10-10
| | | | | | 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
* Fix FS#7679 - modifying files with dircahce enabled doesnt change the access ↵Jonathan Gordon2007-09-02
| | | | | | time/date in dircache git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14580 a1c6a512-1295-4272-9138-f99709370657
* Makes apps and plugins interract with directories using a posix-like api ↵Kevin Ferrare2007-07-20
| | | | | | 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
* avoid declaring shadow 'rc' variables (-Wshadow!)Daniel Stenberg2007-04-26
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13270 a1c6a512-1295-4272-9138-f99709370657
* Removed 'mode' parameter from creat(). It wasn't pure posix anyway, it was ↵Jens Arnold2007-02-01
| | | | | | 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
* Much simpler implementation of large virtual sector support, not needing ↵Jens Arnold2006-12-04
| | | | | | 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
* Add support (runtime detection) for 2048 bytes/sector filesystem.Miika Pekkarinen2006-12-03
| | | | | | | | | 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
* Update dircache startcluster at file close when writing. Fixes bug when ↵Hardeep Sidhu2006-05-16
| | | | | | 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
* Fixed the file renaming/removing issue with dircache enabled.Miika Pekkarinen2006-04-13
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9649 a1c6a512-1295-4272-9138-f99709370657
* Do the dircache operation first to block properly when necessary.Miika Pekkarinen2006-03-30
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9356 a1c6a512-1295-4272-9138-f99709370657
* Boost open() performance on platforms with dircache. Tagcache initialMiika Pekkarinen2006-03-28
| | | | | | | scanning now over 50% faster than before. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9306 a1c6a512-1295-4272-9138-f99709370657
* TAB policed.Jens Arnold2006-03-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8887 a1c6a512-1295-4272-9138-f99709370657
* Change rename() to set errno to EXDEV if a rename is attempted across volumes.Dan Everton2006-03-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8883 a1c6a512-1295-4272-9138-f99709370657
* More compact & straight-forward headbytes handling.Jens Arnold2005-12-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8255 a1c6a512-1295-4272-9138-f99709370657
* Now the file corruption bug when reading & writing the same file isMiika Pekkarinen2005-12-16
| | | | | | | hopefully fully fixed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8251 a1c6a512-1295-4272-9138-f99709370657
* Fixed a file system driver caching bug corrupting files on certain situationsMiika Pekkarinen2005-12-13
| | | | | | | (when reading and writing the same file). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8231 a1c6a512-1295-4272-9138-f99709370657
* Implemented directory caching. No more waiting for disk to spin up whileMiika Pekkarinen2005-10-07
| | | | | | | | 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
* preparations for hotswapping MMCJörg Hohensohn2005-01-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5701 a1c6a512-1295-4272-9138-f99709370657
* int -> long where neededJean-Philippe Bernardy2005-01-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5643 a1c6a512-1295-4272-9138-f99709370657
* prepared to mount multiple partitions into one logical file system (most ↵Jörg Hohensohn2004-12-28
| | | | | | useful for Ondio, internal memory + external MMC) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5514 a1c6a512-1295-4272-9138-f99709370657
* Bug fix: Do only flush the sector buffer after writing head bytes if it ↵Jens Arnold2004-11-17
| | | | | | 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
* void* can't be offset, gcc should not allows thisJörg Hohensohn2004-10-01
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5147 a1c6a512-1295-4272-9138-f99709370657
* Bug fix: open() now handles O_TRUNC correctly (this was the real cause for ↵Jens Arnold2004-09-06
| | | | | | the .playlist_control corruption) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5048 a1c6a512-1295-4272-9138-f99709370657
* Bug fix: renaming a directory could cause a name clash. New feature: ↵Linus Nielsen Feltzing2004-08-22
| | | | | | rename() can now move files/directories as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5008 a1c6a512-1295-4272-9138-f99709370657
* The pathname argument for open() is declared const, so copy it has to be copiedJens Arnold2004-07-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4894 a1c6a512-1295-4272-9138-f99709370657
* No need to call fat_truncate() to delete the file, fat_remove() frees all ↵Linus Nielsen Feltzing2004-04-16
| | | | | | clusters anyway git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4508 a1c6a512-1295-4272-9138-f99709370657
* You can't open() a directory as a file (at least not for writing)Linus Nielsen Feltzing2004-03-10
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4359 a1c6a512-1295-4272-9138-f99709370657