| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
unique vfat filename and use it for temp-dir
Base 38 is still big enough to provide > INT_MAX @ 6 digits.
|
| |
|
|
|
|
| |
`jau::codec::base` and Java `org.jau.util.BaseCodec`
|
|
|
|
|
|
|
| |
safe` Base 64 Alphabet, but keep natural order of value
Used Base 64 safe alphabet: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_`,
i.e. leaving `=` open for padding etc - if so desired in the future for block encoding.
|
|
|
|
| |
base, enhance tests
|
|
|
|
| |
encoding (Java/C++)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
available and read
Header completion (or stream failure) wait_until_completion() shall be passed before
querying available() to properly utilize m_content_size (early out or blocking wait).
Similar at read(), where wait_until_completion() shall be passed before
testing end_of_data(), i.e. !good().
The latter uses ByteInStream_URL's own rdstate() override and queries
m_content_size if m_has_content_length.
Further blocking read is utilized if m_has_content_length (and not end_of_data()),
otherwise only non-blocking read is possible.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
header is complete (or an error occured, i.e. past header streaming stage)
`url_header_sync` allows user to wait until the url streamed header is completed, either
- Final (http) CRLF message received
- Any http header error response received
- First data package received
- End of operation
This way content_size can be awaited and acted accordingly at read,
e.g. a blocking read w/ content_size.
|
|
|
|
|
|
|
|
|
|
| |
capacity upfront for r/w ops
- write interrupt added similar to read interrupt as required to unblock write
- close() interrupting r/w ops added, required to end any operation for out-of-thread closing
- check capacity upfront for r/w ops, avoiding post close() r/w ops
|
|
|
|
| |
convert_bytes_to_jbytearray<T>()
|
|
|
|
| |
types for convenience
|
|
|
|
| |
and all specializations, refine single byte API
|
|
|
|
|
|
| |
- Add ByteOutStream interface
- Add ByteOutStream_File implementation similar to ByteInStream_File, based on POSIX fd etc.
- Add is_open() to ByteInStream and ByteOutStream interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
super iostate_func class for std::basic_ios's iostate functionality
The burden of having a compile time header dependency to ByteInStream is too high
and may cause 'confusion' if linking unit w/ different settings - to say the very least!
In case Botan::DataSource is required, user shall wrap ByteInStream into such desired types.
+++
Don't include any iostream header.
std::basic_ios's iostate functionality allows us to reuse the std spec for our streaming classes,
enforcing a well specified iostate to be defined either by just setting the iostate
at read() for non-async sources like file or
by dynamical evaluation via rdstate() override for async sources.
Use shorter method names, eg check_available() -> available()
and iostream affine names, eg bytes_read() -> tellg().
Use 'void*' buffer types for read() and peak(), similar to POSIX,
removing the burden for a nonsense cast.
Drop ByteInStream_istream.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
- jau::fs::to_named_fd(): Describe stdio names
- file_stats::file_stats
- fix mem leak: Use std::vector<char> for temp buffer, no need to miss ::free()
- initialize dir_item item late via assignment (use default ctor first)
- statx(linux): Only set size if has(field_t::size)
- to_string(): Show size n/a, if n/a
|
| |
|
| |
|
|
|
|
| |
`is_final=true` once at the end, even if input stream has zero size
|
|
|
|
| |
binary; Java: Add dirfd and fd ctor variants
|
|
|
|
|
|
|
| |
consumer_fn() call gets is_final set if next buffer has eof() w/ zero bytes.
This behavior is required for certain operations, i.e. where we cannot have a zero-sized consumer_fn() call as is_final=true.
Example: cipherpack using Botan API, where AEAD::finish() requires the last Tag bytes to be delivered.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
layer to support dirfd and plain fd operations
For state tracking, jau::io::iostate mimics std::iobase::iostate,
only if read reaches eof we do not additionally set failbit!
ctor ByteInStream_File(dirfd, rel_path) is being used
for cipherpack's hash calc method, i.e. to be robust against moving directories.
Further it handles fifo/pipe in a well defined manner, not by chance.
TODO: Figure out when to set irrecoverable badbit for media error.
As of now, we only set failbit on logic errors etc.
TODO: Figure out ByteInStream_File::peek()
- add unit test
- use pread() with offset instead of seek/read.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type -> attribute, support sole file_stats(fd) ctor, ...
A file descriptor (fd) is not a fmode_t type, but an attribute clarifying if instance
was constructed via a fd w/o a path (including named fd) or not.
Hence is_fd() -> has_fd(), useful to avoid ::remove() a file.
For example, stdin could be either a file, a chr (terminal) or a fifo (pipe)
where all variants are has_fd() == true and size() == 0.
+++
Allow instantiation via a sole fd, as required for upcoming pure fd handling.
Taking benefit of the POSIX openat() function group using AT_EMPTY_PATH
and an empty path.
Note that readlinkat() just uses an empty path as the signal for using dirfd alone.
+++
fix named pipe handling: If detecting a named-fd (could be still a link type as well),
simply use the resulting fd and open it via stat().
This avoid issues:
- on FreeBSD where opening the named-fd itself gives the wrong fmode_t
(always chr instead of fifo)
- on Linux where the final fifo/pipe file can't be opened.
|
| |
|
|
|
|
|
|
|
| |
order dependent outcome like a hash value
Implementation only performs the default sort algo on the dir_item::basename() for each directory,
when recursing through the directories.
|
| |
|
|
|
|
| |
content into an already existing destination directory as if destination directory did not exist
|
|
|
|
| |
use global namespace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
jau::io::ByteInStream_File, ...
as well as considering file_stat::is_fd() in
- jau::fs::remove(): Deletion not allowed
jau::io::ByteInStream_File:
- If source path denotes a named file descriptor, i.e. jau::fs::file_stats::is_fd() returns true,
has_content_size() returns false and check_available() returns true as long the stream is open and EOS hasn't occurred.
Note: file_stat::is_fd() and file_stat::is_file() are orthogonal.
+++
This work is covered to allow stream-processing via pipes (e.g. stdin/stdout).
Current use-case is cipherpack's encryption/decryption streaming.
|
|
|
|
| |
by target filesystem if not using follow_symlinks (e.g.: vfat target)
|
|
|
|
| |
'use_space' parameter and print UTC ISO8601 w/ nanoseconds if not zero
|
|
|
|
| |
fix sign alignment and nsec multiples of sec; Fix sign() considering 0 sec and abs() accordingly.
|
|
|
|
| |
visitor process as used by copy() and remove(), removing any transaction 'holes'
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
etc operations and temp-dir for newly dirs (copy) until dirfd retrieved and permissions dropped
Further ..
- add and use dir_item() w/ expicit clean dir- and basename
- file_stats ctor with `dirfd` variant
DRF is achieved via `dirfd` `openat()` etc operations,
avoiding mutations while directories are processed.
See jau::fs::copy() and jau::fs::remove() API doc
+++
Added jau::fs::copy() test `test41_copy_ext_r_p_below()`,
with recursive copy below given and existing destination directory.
|
|
|
|
| |
arm/aarch64 hwcaps using glibc/Linux 'getauxval()' (todo: x86, x86_64 via cpuid)
|
| |
|
|
|
|
| |
''org.jau.nio.UriTk'; C++: 'jau::io::uri' -> 'jau::io::uri_tk'
|
|
|
|
| |
`TestsudoFileUtils02.java`; API-doc: Detail mount/umount capabilities (alt to sudo)
|
|
|
|
| |
test_fileutils01.cpp -> TestFileUtils01.java
|
|
|
|
|
|
| |
op; Drop 'verbose' param for touch(); Use ERR_PRINT() on errors.
Also test touch() w/ current time timestamps, i.e. w/o atime nor mtime variant.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FileUtil mapping jau::fs::file_util.hpp functionality
- FileUtil.compare() is covered via TestByteStream01
- Not mapped:
- dir_item
- fmode_t
- file_stats
TODO
- Test CopyOptions and TraverseOptions
- Partially copy test_fileutils01.cpp and testsudo_fileutils02.cpp
- copy()
- remove()
- mount_image()
|
|
|
|
| |
(-DUSE_LIBCURL=ON or not)
|
|
|
|
| |
call; Add convert_vector_stringview_to_jarraylist() variant
|
| |
|
| |
|
|
|
|
| |
std::move() a std::string w/o copy, clang >= 11
|