summaryrefslogtreecommitdiffstats
path: root/base/file_util.cc
Commit message (Collapse)AuthorAgeFilesLines
* Use platform-appropriate newlines in JSON output.mark@chromium.org2009-06-261-3/+42
| | | | | | | | BUG=15462 TEST=base_unittests, unit_tests, check newlines in bookmarks file Review URL: http://codereview.chromium.org/147220 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19418 0039d316-1c4b-4281-b951-d872f2087c98
* Move PathComponents from file_util to FilePath, add FilePath::IsParent()rafaelw@chromium.org2009-06-241-28/+0
| | | | | | | | r=erikkay,mark Review URL: http://codereview.chromium.org/145026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19174 0039d316-1c4b-4281-b951-d872f2087c98
* Include a parent directory link in the file list for file:///somepathyuzo@chromium.org2009-06-091-0/+19
| | | | | | | | | | | | | | | Also, order files/directories lexicographically. TEST=on linux, type file:///usr/ in the address bar and make sure the contents are sorted and include an entry for '..', which is [parent directory]. On windows, type file:///C:/Users/ . BUG=12621, 12812 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17933 0039d316-1c4b-4281-b951-d872f2087c98
* ImportantFileWriterphajdan.jr@chromium.org2009-04-281-0/+8
| | | | | | | | | | | | | | Introducing a class for writing important files, preventing their corruption during writing. Switched PrefService to use it. Other classes will be switched in future changesets. TEST=This may affect things using preferences. Make sure that changes in preferences don't get lost, and that you don't get excessive disk activity when changing preferences. http://crbug.com/10618 Review URL: http://codereview.chromium.org/83001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14717 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of variable length arrays.willchan@chromium.org2009-04-241-1/+1
| | | | | | Review URL: http://codereview.chromium.org/92005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14440 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated file_util::GetFilenameWithoutExtensionFromPath(), also ↵thestig@chromium.org2009-04-241-6/+0
| | | | | | | | convert ElideFilename() to take a FilePath. Review URL: http://codereview.chromium.org/92060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14409 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 14152.thestig@chromium.org2009-04-211-0/+5
| | | | | | | TBR=tony Review URL: http://codereview.chromium.org/87066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14154 0039d316-1c4b-4281-b951-d872f2087c98
* Stop using and remove deprecated file_util::TrimTrailingSeparator().thestig@chromium.org2009-04-211-5/+0
| | | | | | Review URL: http://codereview.chromium.org/67271 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14152 0039d316-1c4b-4281-b951-d872f2087c98
* Stop using and remove deprecated file_util::TrimFilename().thestig@chromium.org2009-04-211-7/+0
| | | | | | Review URL: http://codereview.chromium.org/67267 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14142 0039d316-1c4b-4281-b951-d872f2087c98
* Separate out file_util functions that use ICU into their own file.sra@chromium.org2009-04-071-72/+1
| | | | | | | | This prevents ~300K of ICU being linked into chrome.exe due to a false dependency. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13281 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* Safe browsing cleanup:estade@chromium.org2009-01-281-0/+6
| | | | | | | | | * wstring -> FilePath * create versions of WriteFile/ReadFile with FilePath signatures Review URL: http://codereview.chromium.org/19610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8797 0039d316-1c4b-4281-b951-d872f2087c98
* Add FilePath version of ReadFileToString.erikkay@google.com2009-01-281-1/+5
| | | | | | Review URL: http://codereview.chromium.org/19401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8774 0039d316-1c4b-4281-b951-d872f2087c98
* Roll forward 8722,8721jeremy@chromium.org2009-01-271-0/+21
| | | | | | Review URL: http://codereview.chromium.org/19028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8734 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 8722,8721.maruel@chromium.org2009-01-271-21/+0
| | | | | | Review URL: http://codereview.chromium.org/19024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8723 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Windows build.jeremy@chromium.org2009-01-271-0/+3
| | | | | | Review URL: http://codereview.chromium.org/19022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8722 0039d316-1c4b-4281-b951-d872f2087c98
* First step of porting VisitedLinkMaster to POSIX:jeremy@chromium.org2009-01-271-0/+18
| | | | | | | | | | | | * Use POSIX file access APIs rather than HANDLEs. * Add stubs so that VisitedLinkMaster compiles on POSIX. Still to be done: * Bring up Surrounding infrastructure to turn on unit tests. Review URL: http://codereview.chromium.org/18530 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8721 0039d316-1c4b-4281-b951-d872f2087c98
* Move Contains() method to file_utils, stop relying on in extensions_protocolaa@chromium.org2009-01-091-0/+27
| | | | | | Review URL: http://codereview.chromium.org/16805 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7841 0039d316-1c4b-4281-b951-d872f2087c98
* Convert download manager to FilePath.estade@chromium.org2009-01-061-6/+16
| | | | | | | | (Fixed up version of issue 17032. Now passes all unit tests.) Review URL: http://codereview.chromium.org/16533 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7630 0039d316-1c4b-4281-b951-d872f2087c98
* Keep trying to undo 7564.estade@chromium.org2009-01-051-5/+1
| | | | | | | | tbr=jhawkins Review URL: http://codereview.chromium.org/17062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7572 0039d316-1c4b-4281-b951-d872f2087c98
* Unbreak unit tests. Revert r7564.estade@chromium.org2009-01-051-17/+11
| | | | | | | | tbr=jhawkins Review URL: http://codereview.chromium.org/16522 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7571 0039d316-1c4b-4281-b951-d872f2087c98
* * switch download manager to using FilePathestade@chromium.org2009-01-051-6/+16
| | | | | | | | | * add empty() function to FilePath * implement file_util::GetFileExtensionFromPath Review URL: http://codereview.chromium.org/17032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7564 0039d316-1c4b-4281-b951-d872f2087c98
* file_util minor cleanup:erikkay@google.com2008-12-231-0/+16
| | | | | | | | | | * add POSIX version of IsPathWritable * convert IsPathWritable to FilePath * convert CreateNewTempDirectory to FilePath * fix a bug where recursive delete errors weren't being handled in POSIX Review URL: http://codereview.chromium.org/16241 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7430 0039d316-1c4b-4281-b951-d872f2087c98
* revert r6938estade@chromium.org2008-12-121-0/+23
| | | | | | | (i.e. reapply 6935, with fix) Review URL: http://codereview.chromium.org/14087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6953 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 6935.ojan@google.com2008-12-121-23/+0
| | | | | | | Broke compile Review URL: http://codereview.chromium.org/14083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6938 0039d316-1c4b-4281-b951-d872f2087c98
* Implement the memory mapped file class for posix.estade@chromium.org2008-12-121-0/+23
| | | | | | Review URL: http://codereview.chromium.org/14073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6935 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of kPathSeparator on windows. Port some wstring function to take ↵estade@chromium.org2008-12-041-7/+59
| | | | | | | | FilePaths. Re-enable relevant posix unit tests. Review URL: http://codereview.chromium.org/12893 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6387 0039d316-1c4b-4281-b951-d872f2087c98
* Remove file_util::kPathSeparator from posix.estade@chromium.org2008-11-271-136/+85
| | | | | | Review URL: http://codereview.chromium.org/12489 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6099 0039d316-1c4b-4281-b951-d872f2087c98
* Append a trailing slash on file directory URLs. Thus a link to /directory ↵estade@chromium.org2008-11-251-9/+26
| | | | | | | | will work just as well as a link to /directory/ Review URL: http://codereview.chromium.org/12620 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5999 0039d316-1c4b-4281-b951-d872f2087c98
* Implement some missing file util functions.estade@chromium.org2008-11-171-0/+6
| | | | | | Review URL: http://codereview.chromium.org/11208 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5571 0039d316-1c4b-4281-b951-d872f2087c98
* Added CreateTemporaryFileName that takes a FilePath argument.estade@chromium.org2008-11-111-0/+7
| | | | | | Review URL: http://codereview.chromium.org/9752 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5142 0039d316-1c4b-4281-b951-d872f2087c98
* Port more of url_request_unittest.cc.dkegel@google.com2008-11-041-1/+7
| | | | | | | | Also do a little bit of the FilePath rewrite as it pertains to this test. Review URL: http://codereview.chromium.org/9074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4652 0039d316-1c4b-4281-b951-d872f2087c98
* Always show file extensions in the shelf.glen@chromium.org2008-11-031-2/+10
| | | | | | | | BUG=1208 Review URL: http://codereview.chromium.org/8991 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4450 0039d316-1c4b-4281-b951-d872f2087c98
* AbsolutePath should probably also work on non-Windows platforms.evanm@google.com2008-10-311-1/+1
| | | | | | | Review URL: http://codereview.chromium.org/8949 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4264 0039d316-1c4b-4281-b951-d872f2087c98
* AbsolutePath should probably actually use its input somewhere.evanm@google.com2008-10-311-1/+1
| | | | | | | Review URL: http://codereview.chromium.org/8948 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4263 0039d316-1c4b-4281-b951-d872f2087c98
* Begin the first small step towards using FilePath everywhere:evanm@google.com2008-10-301-9/+59
| | | | | | | | | | - Add some transition APIs. - Start migrating some code to transition APIs. Review URL: http://codereview.chromium.org/8825 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4254 0039d316-1c4b-4281-b951-d872f2087c98
* Fix another crasher in Spell Checker related to file IO.sidchat@google.com2008-10-211-0/+2
| | | | | | | Issue=3039 Review URL: http://codereview.chromium.org/7528 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3659 0039d316-1c4b-4281-b951-d872f2087c98
* Cross-platform wrappers for fopen, _wfopen_s, etc.mark@chromium.org2008-10-011-10/+10
| | | | | | | | | Patch by Paweł Hajdan jr <phajdan.jr@gmail.com>. http://codereview.chromium.org/6005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2760 0039d316-1c4b-4281-b951-d872f2087c98
* Add file_util::GetFileInfo as a means to provide more information about a filedarin@google.com2008-09-261-0/+8
| | | | | | | | | | | path. This CL changes GetFileSize to be implemented in terms of GetFileInfo since under the hood on all platforms the same system call is used. R=mark Review URL: http://codereview.chromium.org/4286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2624 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes bug in file_util::ReplaceExtension that could chop off pathsky@google.com2008-09-191-5/+27
| | | | | | | | | | | elements. This was causing some folks bookmarks not to get saved! BUG=1946 TEST=covered by unit tests Review URL: http://codereview.chromium.org/2990 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2412 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup some comment typos.ericroman@google.com2008-08-181-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@984 0039d316-1c4b-4281-b951-d872f2087c98
* a few unit tests broke on windows, fix those bugserikkay@google.com2008-08-151-2/+5
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@950 0039d316-1c4b-4281-b951-d872f2087c98
* Part two of file_util porting. Almost all of the functionality has been ↵erikkay@google.com2008-08-151-5/+35
| | | | | | ported, including the unit tests now. Some of this API isn't great, and should be cleaned up, but I'd like to hold off and do that in a followup changelist. More general code cleanup is likely needed here as well. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@944 0039d316-1c4b-4281-b951-d872f2087c98
* To pass string_util_unittest, we need the ICU data file. To get the ICU ↵evanm@google.com2008-08-151-1/+0
| | | | | | data file, we need some of PathService, which brings along with it a bunch of other needed functions. So here are a bunch of stubs, along with another file's worth of passing tests. (Based on a patch from Dean.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@921 0039d316-1c4b-4281-b951-d872f2087c98
* * add base_paths_mac.mm to mac porterikkay@google.com2008-08-081-39/+38
| | | | | | | | * add file_util_posix.cc to mac port (NOTE: untested on linux) * a bit of cleanup in path_service.cc related to this * a few more cleanups to file_util.cc to make it build for mac git-svn-id: svn://svn.chromium.org/chrome/trunk/src@589 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring file_util into file_util and file_util_win. Also fix windows ↵erikkay@google.com2008-08-061-587/+0
| | | | | | | | dependencies in path_service.cc. One questionable decision here was to put GetCurrentDirectory and SetCurrentDirectory into file_util_win.cc. I could have kept the logic in path_service.cc with #ifdefs or I could have split up path_service.cc into path_service_win.cc, etc. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@436 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+852
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98