summaryrefslogtreecommitdiffstats
path: root/base/file_util.cc
Commit message (Collapse)AuthorAgeFilesLines
* Make MemoryMappedFile::IsValid consttommi@chromium.org2011-02-231-1/+1
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/6574005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75794 0039d316-1c4b-4281-b951-d872f2087c98
* Order function definitions in base/ according to the header.erg@google.com2011-01-111-10/+10
| | | | | | | | | BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6085015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70975 0039d316-1c4b-4281-b951-d872f2087c98
* base: Remove deprecated file_util::GetFilenameFromPath function.tfarina@chromium.org2011-01-061-6/+0
| | | | | | | | | BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/6057010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70610 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated AbsolutePath.tfarina@chromium.org2010-12-171-8/+0
| | | | | | | | | BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/5915005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69501 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: don't compile any of the deprecated functions on non-Windowsevan@chromium.org2010-10-131-7/+2
| | | | | | | | We've removed usage of these functions on non-Windows platforms. Review URL: http://codereview.chromium.org/3762002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62470 0039d316-1c4b-4281-b951-d872f2087c98
* Add a TouchFile() function that takes a FilePath argument.dumi@chromium.org2010-09-231-0/+22
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3496005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60381 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add a TouchFile function that operates on FilePaths + fixing a bug"maruel@chromium.org2010-09-231-22/+0
| | | | | | | | | | | | This reverts commit 60322. TBR=dumi TEST=none BUG=none Review URL: http://codereview.chromium.org/3439019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60327 0039d316-1c4b-4281-b951-d872f2087c98
* Add a TouchFile function that operates on FilePaths + fixing a bugdumi@chromium.org2010-09-231-0/+22
| | | | | | | | | | | related to FILE_WRITE_ATTRIBUTES on Windows. BUG=none TEST=FileUtilTest::TouchFile Review URL: http://codereview.chromium.org/3404018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60322 0039d316-1c4b-4281-b951-d872f2087c98
* Moving file_util::FileInfo to base::PlatformFileInfo, and adding thedumi@chromium.org2010-09-031-1/+1
| | | | | | | | | | | | last_accessed and creation_time fields. BUG=none TEST=none Review URL: http://codereview.chromium.org/3347005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58454 0039d316-1c4b-4281-b951-d872f2087c98
* Add an optional parameter to CreatePlatformFile() to report the typedumi@chromium.org2010-08-311-3/+3
| | | | | | | | | | | | of error that occured while trying to open/create a file. TEST=none BUG=none Review URL: http://codereview.chromium.org/3223007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58045 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated version of file_util::ReadFileToString function.tfarina@chromium.org2010-08-311-4/+0
| | | | | | | | | BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/3250004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57944 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Get rid of the deprecated UpOneDirectory function.tfarina@chromium.org2010-07-231-8/+0
| | | | | | | | | | | This removes the latest usage of this function. BUG=24672 TEST=mini_installer_test Review URL: http://codereview.chromium.org/2946007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53434 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Move deprecated function UpOneDirectoryOrEmpty into an anonymous ↵tfarina@chromium.org2010-07-091-10/+0
| | | | | | | | | | | | | | namespace. This function is used in one place and is deprecated, so would be good to move it there so no one can make other uses of it. BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/2809049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51963 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated version of file_util::EndsWithSeparator.tfarina@chromium.org2010-06-211-5/+2
| | | | | | | | | BUG=24672 TEST=out/Debug/base_unittests Review URL: http://codereview.chromium.org/2842015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50330 0039d316-1c4b-4281-b951-d872f2087c98
* Add histograms to track the size of the profile data.rvargas@google.com2010-06-111-0/+18
| | | | | | | | | | BUG=16705 TEST=FileUtilTest.FileAndDirectorySize Review URL: http://codereview.chromium.org/2778006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49606 0039d316-1c4b-4281-b951-d872f2087c98
* Return NULL instead of false when appropriate.evan@chromium.org2010-06-101-1/+1
| | | | | | | | (Found by clang.) Review URL: http://codereview.chromium.org/2725010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49466 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated file_util::ReplaceExtension API.tfarina@chromium.org2010-06-011-27/+0
| | | | | | | | | BUG=24672 TEST=out/Debug/base_unittests Review URL: http://codereview.chromium.org/2445001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48614 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Convert the wstring version of IsDirectoryEmpty to FilePath.tfarina@chromium.org2010-05-261-1/+10
| | | | | | | | | BUG=24672 TEST=compiles Review URL: http://codereview.chromium.org/2153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48237 0039d316-1c4b-4281-b951-d872f2087c98
* page cycler: Use buffer-cache priming code on all systems.evan@chromium.org2010-05-191-1/+2
| | | | | | | | | | | I noticed that the first time I run the page cycler the test numbers are worse, probably because the test pages are not in cache. We already have this code on Mac and I don't see why it shouldn't apply to all systems. Review URL: http://codereview.chromium.org/2096005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47650 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated version of GetCurrentDirectory.evan@chromium.org2010-04-211-7/+0
| | | | | | | | BUG=24672 Review URL: http://codereview.chromium.org/1751005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45247 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the wstring versions of GetFileInfo, GetFileSize, GetTempDir.evan@chromium.org2010-04-211-13/+0
| | | | | | | | | TEST=compiles BUG=24672 Review URL: http://codereview.chromium.org/1753004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45246 0039d316-1c4b-4281-b951-d872f2087c98
* Function to compute the total size of the files in a directorycpu@chromium.org2010-03-241-0/+17
| | | | | | | | | | | | | We need this for the diagnostic mode but it can be used by others. Did not see test for GetFileSize() so added them BUG=none TEST=ut included Review URL: http://codereview.chromium.org/1220001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42540 0039d316-1c4b-4281-b951-d872f2087c98
* Deprecate file_util::AppendToPath() on non-Windows.evan@chromium.org2010-02-261-4/+6
| | | | | | | | | | | | We still have ~150 callers to AppendToPath in our code, but most of them are in the installer and I'm reluctant to fiddle with that code without having an easy way to test it. BUG=24672 Review URL: http://codereview.chromium.org/654013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40120 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure the parent directory always comes first when listing directories.estade@chromium.org2010-02-111-8/+8
| | | | | | | | | BUG=35288 TEST=see bug Review URL: http://codereview.chromium.org/596054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38854 0039d316-1c4b-4281-b951-d872f2087c98
* Minor cleanup; remove deprecate file_util function and some obsolete TODOs.estade@chromium.org2009-12-091-3/+0
| | | | | | Review URL: http://codereview.chromium.org/467030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34133 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the deprecated version of ContentsEqual.thakis@chromium.org2009-12-011-5/+0
| | | | | | | | | | BUG=24672 TEST=base_unittests Review URL: http://codereview.chromium.org/432001 Patch from tfarina. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33483 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Remove deprecated function SetCurrentDirectory.thestig@chromium.org2009-11-251-3/+0
| | | | | | | | | | | BUG=24672 TEST=None Original Review URL: http://codereview.chromium.org/391059 Patch from Thiago Farina <thiago.farina@gmail.com>. Review URL: http://codereview.chromium.org/434093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33135 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Fix some callers of CreateNewTempDirectory to remove the ↵evan@chromium.org2009-11-191-13/+0
| | | | | | | | | | | | | deprecated version. BUG=None TEST=unit_tests Patch from Thiago Farina <thiago.farina@gmail.com>. Review URL: http://codereview.chromium.org/385112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32487 0039d316-1c4b-4281-b951-d872f2087c98
* reland 31875. Revert was:estade@chromium.org2009-11-161-0/+27
| | | | | | | | | | | | | | ------ Revert 31875 to see whether it fixes reliability bot. BUG=25677 TEST=None ------ TBR=huanr Review URL: http://codereview.chromium.org/397017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32112 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 31875 to see whether it fixes reliability bot.huanr@chromium.org2009-11-161-27/+0
| | | | | | | | | BUG=25677 TEST=None Review URL: http://codereview.chromium.org/397014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32074 0039d316-1c4b-4281-b951-d872f2087c98
* Use renderer spellchecker for windows.estade@chromium.org2009-11-131-0/+27
| | | | | | | BUG=25677 Review URL: http://codereview.chromium.org/372075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31875 0039d316-1c4b-4281-b951-d872f2087c98
* Re-try r29078: Remove some deprecated file_util wstring functions.estade@chromium.org2009-10-151-14/+0
| | | | | | | | | | | | | With the previous patch, the try bots failed with mysterious messages, so I ignored them, patched it into my windows box and tested it there manually, and found no problems. As it turns out, the try failures were real :(. But nsylvain and I found the problem: the behavior of file_util::GetDirectoryFromPath() differs from DirName() when the path is empty (officially, GetDirectoryFromPath is not supposed to support non-absolute paths, but that is not enforced). Here is a green win try result: http://build.chromium.org/buildbot/try-server/builders/win/builds/3705 mac: http://build.chromium.org/buildbot/try-server/builders/mac/builds/3491 linux: http://build.chromium.org/buildbot/try-server/builders/linux/builds/3466 I also applied this patch locally in Windows to test that it doesn't break the chrome frame compile or tests, since that's not covered by the trybots yet. Review URL: http://codereview.chromium.org/271099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29094 0039d316-1c4b-4281-b951-d872f2087c98
* Remove file_util::TrimTrailingSeparators(), which is deprecated andtkent@chromium.org2009-10-151-5/+0
| | | | | | | | | | doesn't work well for Windows root drives. BUG=24722 TEST=existing tests are enough. Review URL: http://codereview.chromium.org/271086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29093 0039d316-1c4b-4281-b951-d872f2087c98
* Revert wstring patch (r29078 and follow up commits). It is causing failures ↵estade@chromium.org2009-10-151-0/+14
| | | | | | | | | | on the buildbots. TBR=nsylvain Review URL: http://codereview.chromium.org/280004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29085 0039d316-1c4b-4281-b951-d872f2087c98
* Remove some deprecated file_util wstring functions.estade@chromium.org2009-10-151-14/+0
| | | | | | | | | | | death to the wstring TEST=trybots BUG=none Review URL: http://codereview.chromium.org/276016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29078 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Remove deprecated AbsolutePath function."evan@chromium.org2009-10-091-0/+7
| | | | | | This reverts commit r28593. Random guess at build breakage. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28596 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated AbsolutePath function.evan@chromium.org2009-10-091-7/+0
| | | | | | Review URL: http://codereview.chromium.org/271037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28593 0039d316-1c4b-4281-b951-d872f2087c98
* Copy the relevant parts of ICU to a new file base/third_party/icu/icu_utf.*brettw@chromium.org2009-10-071-3/+2
| | | | | | | | | | | | | | so we can do basic UTF8/16/32 conversions without linking all of ICU. Change callers who used to call SysUTF8ToWide/SysWideToUTF8 in base to using these new functions. I will remove the Sys versions of these functions in a later patch. TEST=none BUG=none Review URL: http://codereview.chromium.org/243102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28219 0039d316-1c4b-4281-b951-d872f2087c98
* Removes deprecated version of PathIsWritable which is no longer called by ↵erikkay@chromium.org2009-09-111-3/+0
| | | | | | | | | | | | any function. BUG=None TEST=None Review URL: http://codereview.chromium.org/196038 Patch from thiago.farina@gmail.com. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25990 0039d316-1c4b-4281-b951-d872f2087c98
* Renames the function CreateTemporaryFilename to CreateTemporaryFile and ↵erikkay@chromium.org2009-08-181-7/+0
| | | | | | | | | | | | | | track down all callers, also removes the deprecated function that uses std::wstring. BUG=3078 (http://crbug.com/3078) TEST=run base_unittests, installer_util_unittests, net_unittests, setup_unittests, and unit_tests. Review URL: http://codereview.chromium.org/164537 Patch from Thiago Farina. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23631 0039d316-1c4b-4281-b951-d872f2087c98
* 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