aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/doc/src/file.xml
AgeCommit message (Collapse)Author
2018-02-26Allow opening device files and FIFOs with file:open/2John Högberg
To the best of our knowledge this was introduced since file operations on device files/FIFO:s could hang the emulator forever back when the emulator was single-threaded and lacked IO threads; a read operation could block all progress preventing the write operation it waited for from occurring. Granted, this could still happen through starving all dirty IO schedulers, but the same issue can arise with NFS files which we've always allowed. Removing this restriction also lets us remove a stat(2) call that was added to specifically allow `/dev/null`.
2018-01-03Disallow NULs in filename-encoded stringsJohn Högberg
Previously we accepted trailing NULs, which was backwards compatible as such usage never resulted in misbehavior in the first place. The downside is that it prevented erts_native_filename_need from returning an accurate number of *actual characters*, needlessly complicating encoding-agnostic code like erts_osenv.
2017-11-30Remove doc for sendfile/5 use_threads optionJohn Högberg
The option no longer does anything; systems that lack support for non-blocking sendfile(2) will use the Erlang fallback.
2017-11-30Update file performance adviceJohn Högberg
The parts relating to drivers/ports are now obsolete, and the provided example was far noisier than it had to be; the only relevant metric is the number of calls and it's up to the user to decide how those will be reduced. One could argue for its complete removal, but I'm inclined to leave it be.
2017-10-11Don't allow null chars in various stringsRickard Green
Various places that now reject null chars inside strings - Primitive file operations reject it in filenames. - Primitive environment variable operations reject it in names and values. - os:cmd() reject it in its input. Also '=' characters are rejected by primitive environment variable operations in environment variable names. Documentation has been updated to document null characters in these types of data as invalid. Currently these operations accept null chars at the end of strings, but that will change in the future.
2016-10-17Clarify permission bits in file.xmlMagnus Henoch
In commit 3d70cee4034e, this text was changed to suggest that a list of Unix-specific permission bits would follow, but no such list was added. Let's revert back to the previous wording, so people won't look for a list that isn't there.
2016-09-06kernel: Correct file(3)Hans Bolinder
2016-09-01doc: Correct errors introduced by Editorial changesHans Bolinder
Fix some older errors as well.
2016-05-17kernel: Remove no longer needed anchors in documentationHans Bolinder
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-03-31Update Kernel documentationBjörn Gustavsson
Language cleaned up by technical writers from Combitech. Proofreading and corrections by Björn Gustavsson and Hans Bolinder.
2016-03-15update copyright-yearHenrik Nord
2015-11-04Fix typos and grammarDerek Brown
2015-11-04[kernel] Correct documentationHans Bolinder
Fix mistakes found by 'xmllint'.
2015-06-18Change license text to APLv2Bruce Yinhe
2014-11-26Merge branch 'maint'Lukas Larsson
* maint: kernel: Do not check unsync:ed file size Introduce new option 'raw' in file_info functions
2014-11-26Merge branch 'nox/read_file_info-raw/OTP-12325' into maintLukas Larsson
* nox/read_file_info-raw/OTP-12325: kernel: Do not check unsync:ed file size Introduce new option 'raw' in file_info functions
2014-11-18Update file.xmlMarc Sugiyama
Fix grammatical errors in section on file:datasync/1
2014-06-28Introduce new option 'raw' in file_info functionsAnthony Ramine
This option allows the caller not to go through the file server for information about files guaranteed to be local.
2014-06-13Remove documentation and stub for non-exist file:file_info/1Björn Gustavsson
file:file_info/1 was removed a long time ago, but its documentation was not removed.
2014-03-24Merge branch 'sverk/win-long-filenames/OTP-11813'Sverker Eriksson
* sverk/win-long-filenames/OTP-11813: erts: Cleanup debug tracing in win_efile.c erts: Fix file:list_dir for windows paths 258 or 259 chars long erts: Increase MAXPATHLEN to 4096 for windows erts: Fix bug in efile_readlink for long win paths kernel: Fix failed tests in prim_file_SUITE for windows erts: Fix compiler warning in win_efile.c erts: Skip tests of paths longer than 255 characters as atoms erts: Skip tests of file:set_cwd for too long path on Windows erts: Make file:make_symlink/2 return {error,eperm} on Windows erts: Revert file:set_cwd impl for windows erts: Ignore reduntant slashes in windows paths fix file_SUITE:cur_dir_0 for long windows paths erts: Fix file_SUITE:make_del_dir for long paths erts: Fix long windows paths for compressed files erts: Use GetFullPathNameW to construct abs paths from relative ones erts: Fix file driver to handle long paths on windows Conflicts: erts/emulator/drivers/win32/win_efile.c
2014-03-24erts: Make file:make_symlink/2 return {error,eperm} on WindowsSverker Eriksson
if the user has not the privilege SE_CREATE_SYMBOLIC_LINK_NAME
2014-03-19Merge branch 'josevalim/set_cwd-typespec'Henrik Nord
* josevalim/set_cwd-typespec: Correct file:set_cwd/1 typespec OTP-11787
2014-03-10Correct file:set_cwd/1 typespecJosé Valim
file:set_cwd/1 accepts binaries as arguments, however the binaries must be properly encoded as per file:native_name_encoding/0. Also update the note under no_translation error to refer that passing a ISO-latin-1 encoded binary under any unicode file name encoding.
2014-02-06Make the references to various Erlang/OTP releases verboseHans Bolinder
2014-01-29Merge branch 'bjorn/fna-default/OTP-11612'Björn Gustavsson
* bjorn/fna-default/OTP-11612: Change the default file name encoding mode to +fnaw
2014-01-28Change the default file name encoding mode to +fnawBjörn Gustavsson
2014-01-27erts/kernel: sendfile no longer uses async threadsLukas Larsson
This has been done because a slow client attack is possible if the async thread pool is used. The scenario is: Client does a request for a file and then slowly receives the file one byte at a time. This will eventually fill the async thread pool with blocking sendfile operations and thus starving the vm of all file operations. If you still want to use the async threads pool for sendfile an option to enable it has been introduced.
2013-11-29Merge branch 'sv/file-osync/OTP-11498'Lukas Larsson
* sv/file-osync/OTP-11498: Add sync option to file:open/2 Conflicts: erts/preloaded/ebin/prim_file.beam
2013-11-15Add sync option to file:open/2Joseph Blomstedt
The sync option adds the POSIX O_SYNC flag to the open system call on platforms that support the flag or its equivalent, e.g., FILE_FLAG_WRITE_THROUGH on Windows. For platforms that don't support it, file:open/2 returns {error, enotsup} if the sync option is passed in. The semantics of O_SYNC are platform-specific. For example, not all platforms guarantee that all file metadata are written to the disk along with the file data when the flag is in effect. This issue is noted in the documentation this commit adds for the sync option. Add a test for the sync option. Note however that the underlying OS semantics for O_SYNC can't be tested automatically in any practical way, so the test assumes the OS does the right thing with the flag when present. For manual verification, dtruss on OS X and strace on Linux were both run against beam processes to watch calls to open(), and file:open/2 was called in Erlang shells to open files for writing, both with and without the sync option. Both the dtruss output and the strace output showed that the O_SYNC flag was present in the open() calls when sync was specified and was clear when sync was not specified.
2013-04-19Convert XML files to UTF-8Hans Bolinder
2013-02-22Merge branch 'hb/file_name_type/OTP-10852'Patrik Nyblom
* hb/file_name_type/OTP-10852: Introduce new type file:name_all()
2013-02-21Introduce new type file:name_all()Hans Bolinder
2013-02-14file: Document list_dir_all/1 and read_link_all/1Björn Gustavsson
2013-02-14file: Remove note about Unicode handling being experimentalBjörn Gustavsson
2013-02-13Make the file:filename() type more restrictiveBjörn Gustavsson
The recommended type for filenames is a list of characters (which may be Unicode characters greater than 255). Change the file:filename() to reflect that. For the filename module we still need a type that can be either a string or a binary, so we need to introduce the type file:filename_all().
2013-02-11Make Unicode correctionsHans Bolinder
2013-01-21[hipe, kernel, stdlib] Correct a few typesHans Bolinder
The type ascii_string() in the base64 module has been corrected. The type file:file_info() has been cleaned up. The type file:fd() has been made opaque in the documentation. The type nodes() has been removed from erl_bif_types.erl.
2013-01-09Add file:allocate/3 operationFilipe David Manana
This operation allows pre-allocation of space for files. It succeeds only on systems that support such operation. The POSIX standard defines the optional system call posix_fallocate() to implement this feature. However, some systems implement more specific functions to accomplish the same operation. On Linux, if the more specific function fallocate() is implemented, it is used instead of posix_fallocate(), falling back to posix_fallocate() if the fallocate() call failed (it's only supported for the ext4, ocfs2, xfs and btrfs file systems at the moment). On Mac OS X it uses the specific fcntl() operation F_PREALLOCATE, falling back to posix_fallocate() if it's available (at the moment Mac OS X doesn't provide posix_fallocate()). On any other UNIX system, it uses posix_fallocate() if it's available. Any other system not providing this system call or any function to pre-allocate space for files, this operation always fails with the ENOTSUP POSIX error.
2013-01-02Clean up some of the Unicode documentationHans Bolinder
2013-01-02[stdlib, kernel] Introduce Unicode support for Erlang source filesHans Bolinder
Expect modifications, additions and corrections. There is a kludge in file_io_server and erl_scan:continuation_location() that's not so pleasing.
2012-12-20Basic documentation of the 'ram' mode in the 'file' moduleJan Daniel Bothma
2012-01-27Move types and specs from erl_bif_types.erl to modulesHans Bolinder
2011-12-08Merge branch 'egil/file-info-opt-utc/OTP-7687'Björn-Egil Dahlberg
* egil/file-info-opt-utc/OTP-7687: (39 commits) Remove time_t specific test in prim_file_SUITE Update prim_file.beam and prim_zip.beam Add types for posixtime_to_universaltime and the reverse Set BASEYEAR to 1902 Set lower limit of years handled to 1601 Emulate localtime, gmtime and mktime to enable negative time_t Document file:*_file_info/2 Fix compiler warning in unix_efile.c Change name of bif universaltime_to_seconds/1 Change options to prim_file:*_file_info/* Remove dead code Catch errors from prim_file:*_file_info Testcase for utc <-> seconds conversion Fix negative time in seconds_to_universaltime/1 Remove OS taint from datetime conversion Add utc <-> seconds conversions bifs Let prim_file validate ctime in file_info Teach #file_info spec unix epochs for file times Add file_info_opt tests in prim_file_SUITE unix_efile: Zero is a valid number in utime ... Conflicts: erts/emulator/beam/erl_time_sup.c erts/emulator/sys/win32/erl_win_sys.h erts/emulator/sys/win32/sys_time.c
2011-12-08Document file:*_file_info/2Björn-Egil Dahlberg
* file:read_file_info/2 * file:write_file_info/3 Document options and time behavior.
2011-12-05file: correct make_link/2 and make_symlink/2 docsTuncer Ayaz
2011-12-02Remove header/trailer supportLukas Larsson
Since the API for headers/trailers seem to be very awkward to work with when using non-blocking io the feature is dropped for now. See unix_efile.c for more details.
2011-12-02Expand sendfile documentationLukas Larsson
2011-11-29Implement file:sendfileTuncer Ayaz
Allow Erlang code to use sendfile() where available by wrapping it as file:sendfile/4 and file:sendfile/2. sendfile(2) - Linux man page: "sendfile() copies data between one file descriptor and another. Because this copying is done within the kernel, sendfile() is more efficient than the combination of read(2) and write(2), which would require transferring data to and from user space."
2011-09-26Correct XML filesHans Bolinder