summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Remove deprecated AbsolutePath function."evan@chromium.org2009-10-091-0/+2
| | | | | | 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-2/+0
| | | | | | Review URL: http://codereview.chromium.org/271037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28593 0039d316-1c4b-4281-b951-d872f2087c98
* Separate out some more ICU from base and into base/i18n.brettw@chromium.org2009-10-081-18/+1
| | | | | | | | | | | | | | | | | | | | This moves string_util_icu. I moved the number formatting function into base/i18n/number_formatting and just removed the other function in string_util_icu which was TrimWhitespaceUTF8. It is only used in a few places and isn't actually helpful (and the fact that it round-trips through UTF-16 is better for the caller to see). This takes out the sorting from the FileEnumerator. The comment says the sorting is not guaranteed. I moved it into file_util_icu as a standalone function for callers of FileEnumerator to call manually if they need sorted results. I modified the directory lister to use this sorting instead, and filed a bug on doing more optimal JS-based sorting. TEST=none BUG=none Review URL: http://codereview.chromium.org/267001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28405 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: print page to file rather than using shared memory to send it to the ↵estade@chromium.org2009-09-161-0/+4
| | | | | | | | | | | | browser. BUG=9847 adapted from patch by <minyu.huang [at] gmail> Review URL: http://codereview.chromium.org/203062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26308 0039d316-1c4b-4281-b951-d872f2087c98
* Removes deprecated version of PathIsWritable which is no longer called by ↵erikkay@chromium.org2009-09-111-2/+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
* Remove uses of deprecated version of FileUtil::ResolveShortcut.evan@chromium.org2009-08-251-4/+3
| | | | | | | | | | BUG=None TEST=run base_unittests.exe Review URL: http://codereview.chromium.org/173181 Patch from Thiago Farina <thiago.farina@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24208 0039d316-1c4b-4281-b951-d872f2087c98
* Renames the function CreateTemporaryFilename to CreateTemporaryFile and ↵erikkay@chromium.org2009-08-181-9/+4
| | | | | | | | | | | | | | 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
* Define _FILE_OFFSET_BITS=64 in order to support large files (>2GB).thestig@chromium.org2009-08-061-5/+21
| | | | | | | | | | | | | | | | | | _FILE_OFFSET_BITS=64 is incompatible with fts (issue 17492), so file_util::Delete, file_util::CopyDirectory file_util::FileEnumerator are reimplemented without fts. Delete and CopyDirectory are now implemented using FileEnumerator. Patch from vandebo@google.com, original review: http://codereview.chromium.org/160479 BUG=13718,17492 TEST=none Review URL: http://codereview.chromium.org/165085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22670 0039d316-1c4b-4281-b951-d872f2087c98
* Adding last modified time to file_utilbrettw@chromium.org2009-07-241-0/+4
| | | | | | | | | Original review: http://codereview.chromium.org/160050 Patch by dhg@google.com Review URL: http://codereview.chromium.org/159347 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21533 0039d316-1c4b-4281-b951-d872f2087c98
* Use platform-appropriate newlines in JSON output.mark@chromium.org2009-06-261-0/+4
| | | | | | | | 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
* Replace std:;wstring with std::string and string16 in locale-name related APIs.jshin@chromium.org2009-06-241-1/+6
| | | | | | | | | | | | | | | 1. Change the locale param to be std::string because they're always ASCII and change call-sites accordingly. 2. Add GetStringFUTF16 to l10n_util. On Windows, they're inline helpers calling the correspondingGetStringF returning wstring while on Mac/Linux, they just return the result of |string16 GetStringF|without converting to wstring. This is part 1 of the fix for issue 8647. Some of newly introduced conversions are temporary and will be removed later (e.g. ASCIIToWide applied to the result of GetApplicationLocale in a few places). Note : this CL will be landed after http://codereview.chromium.org/147038 is landed. BUG=8647 (http://crbug.com/8647) TEST=Pass l10n_util_unittest and other unit tests Review URL: http://codereview.chromium.org/126223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19183 0039d316-1c4b-4281-b951-d872f2087c98
* Move PathComponents from file_util to FilePath, add FilePath::IsParent()rafaelw@chromium.org2009-06-241-4/+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-3/+12
| | | | | | | | | | | | | | | 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
* Reorder fts(3) includes per the man page, as fts.h uses sys/types.h. On ↵evan@chromium.org2009-06-031-2/+3
| | | | | | | | | linux, <sys/types.h> happened to be define before this anyway, but on other POSIX systems this is not the case. Review URL: http://codereview.chromium.org/119110 Patch from Peter Valchev <pvalchev@google.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17541 0039d316-1c4b-4281-b951-d872f2087c98
* Removes the following deprecated functions:ojan@chromium.org2009-06-031-11/+0
| | | | | | | | | | | | | | | | file_util::InsertBeforeExtension(wstring*, wstring&) file_util::PathComponents(wstring&, vector<wstring>*) file_util::ReplaceExtension(wstring*, wstring&) BUG=none TEST=manual test for importing IE bookmarks with some sub-directories. Original patch by tkent@google.com. See http://codereview.chromium.org/118109 r=ojan,estade git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17469 0039d316-1c4b-4281-b951-d872f2087c98
* Hook up more of extension uninstall.aa@chromium.org2009-05-211-1/+1
| | | | | | | | | | | Also removed all external dependencies from ExtensionsService. It now only sends out notifications, which other services consume. This should allow us to unit test the ExtensionsService frontend, but I haven't added that yet. Review URL: http://codereview.chromium.org/113493 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16676 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Hook up more of extension uninstall."aa@chromium.org2009-05-211-1/+1
| | | | | | | | This reverts commit ebb5f616663f9d5ee78584187da16bba4ce96811. Review URL: http://codereview.chromium.org/113680 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16557 0039d316-1c4b-4281-b951-d872f2087c98
* Hook up more of extension uninstall.aa@chromium.org2009-05-201-1/+1
| | | | | | | | | | | Also removed all external dependencies from ExtensionsService. It now only sends out notifications, which other services consume. This should allow us to unit test the ExtensionsService frontend, but I haven't added that yet. Review URL: http://codereview.chromium.org/113493 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16547 0039d316-1c4b-4281-b951-d872f2087c98
* TBR: Revert "Hook up more of extension uninstall."aa@chromium.org2009-05-201-1/+1
| | | | | | | | This reverts commit 5b2fc12fbca26b20ed4176ac740c58fe49360c4a. Review URL: http://codereview.chromium.org/113664 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16538 0039d316-1c4b-4281-b951-d872f2087c98
* Hook up more of extension uninstall.aa@chromium.org2009-05-201-1/+1
| | | | | | | | | | | Also removed all external dependencies from ExtensionsService. It now only sends out notifications, which other services consume. This should allow us to unit test the ExtensionsService frontend, but I haven't added that yet. Review URL: http://codereview.chromium.org/113493 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16529 0039d316-1c4b-4281-b951-d872f2087c98
* Add file_util::ReplaceFile and use it in ImportantFileWriter.phajdan.jr@chromium.org2009-05-191-0/+7
| | | | | | | | | | It has more strict semantics than file_util::Move. http://crbug.com/11585 Review URL: http://codereview.chromium.org/113207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16386 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add file_util::ReplaceFile and use it in ImportantFileWriter."phajdan.jr@chromium.org2009-05-181-7/+0
| | | | | | | | | | http://crbug.com/11585 TBR=stoyan Review URL: http://codereview.chromium.org/113534 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16296 0039d316-1c4b-4281-b951-d872f2087c98
* Add file_util::ReplaceFile and use it in ImportantFileWriter.phajdan.jr@chromium.org2009-05-181-0/+7
| | | | | | | | | | It has more strict semantics than file_util::Move. http://crbug.com/11585 Review URL: http://codereview.chromium.org/113207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16291 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for almost-recursive watches in Linux DirectoryWatcherphajdan.jr@chromium.org2009-05-141-0/+6
| | | | | | | | | | | | | | | | | After this patch DirectoryWatcher when asked for recursive watch will scan the subtree and add inotify watches for each subfolder, but further changes to the tree structure won't trigger adding/removing watches. Support for really recursive watches is planned. This is just to divide the work, because the task is not easy. Based on patch by Janwar Dinata <j.dinata@gmail.com> reviewed at http://codereview.chromium.org/92151 http://crbug.com/8968 Review URL: http://codereview.chromium.org/115229 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16070 0039d316-1c4b-4281-b951-d872f2087c98
* posix: directories should only be readable by the user.evan@chromium.org2009-05-121-1/+1
| | | | | | | | | | | | | Almost all the data we store is private, so we shouldn't even allow it to be group-readable. Note that files still obey the user's umask and if someone wants to make their download directory world-readable we won't undo that. BUG=11776 Review URL: http://codereview.chromium.org/113287 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15890 0039d316-1c4b-4281-b951-d872f2087c98
* ImportantFileWriterphajdan.jr@chromium.org2009-04-281-0/+3
| | | | | | | | | | | | | | 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
* POSIX: Make --user-data-dir work when it doesn't exist.agl@chromium.org2009-04-271-1/+1
| | | | | | | | | | | | | | | | | Previously, --user-data-dir called PathService::Override which called AbsolutePath. On POSIX, this calls realpath and fails if the given path doesn't actually exist. We need to do this on Windows because we change the current directory in order to load plugins (at least). However, on POSIX we shouldn't ever change cwd. So, on POSIX, don't try to make the user-data-dir absolute. TEST=On POSIX, start chrome with --user-data-dir=/tmp/xyz (where xyz is a directory which doesn't exist). Once running, check that /tmp/xyz exists and contains the expected files. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14679 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated file_util::GetFilenameWithoutExtensionFromPath(), also ↵thestig@chromium.org2009-04-241-3/+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
* Protect RandUint64 against EINTR.phajdan.jr@chromium.org2009-04-231-0/+7
| | | | | | Review URL: http://codereview.chromium.org/77022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14297 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-5/+0
| | | | | | Review URL: http://codereview.chromium.org/67267 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14142 0039d316-1c4b-4281-b951-d872f2087c98
* Implement file_util::CountFilesCreatedAfter() for posix environments.evan@chromium.org2009-04-211-3/+6
| | | | | | | | | BUG=9833 Review URL: http://codereview.chromium.org/87003 Patch from Shinichiro Hamaji <hamaji@google.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14081 0039d316-1c4b-4281-b951-d872f2087c98
* Retrial of the first step to port file_util::CountFilesCreatedAfter()erikkay@google.com2009-04-181-4/+7
| | | | | | | | | Submitting http://codereview.chromium.org/75033 on behalf of hamaji Review URL: http://codereview.chromium.org/67276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13993 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 13748.erikkay@google.com2009-04-151-7/+4
| | | | | | Review URL: http://codereview.chromium.org/73084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13751 0039d316-1c4b-4281-b951-d872f2087c98
* Submitting http://codereview.chromium.org/73075 on behalf of ↵erikkay@google.com2009-04-151-4/+7
| | | | | | | | shinichiro.hamaji@gmail.com Review URL: http://codereview.chromium.org/73083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13748 0039d316-1c4b-4281-b951-d872f2087c98
* First pass of refactoring dialogs.avi@chromium.org2009-04-061-0/+2
| | | | | | Review URL: http://codereview.chromium.org/60110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13168 0039d316-1c4b-4281-b951-d872f2087c98
* Implement DownloadFile::Rename() for posix. Downloads work on linux!estade@chromium.org2009-03-131-1/+3
| | | | | | Review URL: http://codereview.chromium.org/46020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11659 0039d316-1c4b-4281-b951-d872f2087c98
* file_util::Move fails on Windows if moving a directoryhuanr@chromium.org2009-03-111-0/+6
| | | | | | | | | | | across volumes. This change adds a CopyAndDeleteDirectory function, and Move falls back to CopyAndDeleteDirectory if moving directory fails. BUG=8505 Review URL: http://codereview.chromium.org/43069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11460 0039d316-1c4b-4281-b951-d872f2087c98
* Properly honor base::SharedMemory semantics for name="" to meanjrg@chromium.org2009-02-041-0/+12
| | | | | | | | | | | | new/private shared memory on POSIX. Transition base::SharedMemory implementation to file/mmap() to prevent leaking of wired kernel resources and allow easier cleanup. Enable one more shared_memory unit test for POSIX. Enable stats_table_unittest.cc for Mac, and modify it so it cleans up. Review URL: http://codereview.chromium.org/19724 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9114 0039d316-1c4b-4281-b951-d872f2087c98
* Safe browsing cleanup:estade@chromium.org2009-01-281-0/+4
| | | | | | | | | * 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-0/+2
| | | | | | 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/+17
| | | | | | 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-17/+0
| | | | | | Review URL: http://codereview.chromium.org/19024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8723 0039d316-1c4b-4281-b951-d872f2087c98
* First step of porting VisitedLinkMaster to POSIX:jeremy@chromium.org2009-01-271-0/+17
| | | | | | | | | | | | * 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-4/+3
| | | | | | Review URL: http://codereview.chromium.org/16805 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7841 0039d316-1c4b-4281-b951-d872f2087c98
* Add implementations of various extension related methods (derived from ↵erikkay@google.com2009-01-091-13/+9
| | | | | | | | | | | | file_util): Extension, RemoveExtension, InsertBeforeExtension, ReplaceExtension I didn't reimplement the old file_util ones since they actually modify the FilePath in place, which isn't the style of the rest of the FilePath methods. I'll file a cleanup bug after this for callers to switch to the new methods. Review URL: http://codereview.chromium.org/17243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7811 0039d316-1c4b-4281-b951-d872f2087c98
* Convert download manager to FilePath.estade@chromium.org2009-01-061-2/+4
| | | | | | | | (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
* Unbreak unit tests. Revert r7564.estade@chromium.org2009-01-051-2/+0
| | | | | | | | 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-0/+2
| | | | | | | | | * 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