OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
gslib
/
commands
/
__pycache__
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/11/2025 08:19:49 AM
rwxr-xr-x
📄
__init__.cpython-39.pyc
323 bytes
02/11/2025 08:19:49 AM
rw-r--r--
📄
acl.cpython-39.pyc
18.76 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
autoclass.cpython-39.pyc
6.01 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
bucketpolicyonly.cpython-39.pyc
6.75 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cat.cpython-39.pyc
4.17 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
compose.cpython-39.pyc
4.57 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
config.cpython-39.pyc
40.97 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cors.cpython-39.pyc
6.56 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cp.cpython-39.pyc
42.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
defacl.cpython-39.pyc
11.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
defstorageclass.cpython-39.pyc
5.78 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
du.cpython-39.pyc
8.47 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
hash.cpython-39.pyc
7.87 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
help.cpython-39.pyc
6.41 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
hmac.cpython-39.pyc
12.39 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
iam.cpython-39.pyc
24.6 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
kms.cpython-39.pyc
14.88 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
label.cpython-39.pyc
10.46 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
lifecycle.cpython-39.pyc
6.37 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
logging.cpython-39.pyc
9.04 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ls.cpython-39.pyc
18.81 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
mb.cpython-39.pyc
12.23 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
mv.cpython-39.pyc
5.06 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
notification.cpython-39.pyc
25.47 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
pap.cpython-39.pyc
6.53 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
perfdiag.cpython-39.pyc
62.18 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rb.cpython-39.pyc
3.78 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
requesterpays.cpython-39.pyc
5.53 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retention.cpython-39.pyc
20.02 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rewrite.cpython-39.pyc
16.12 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rm.cpython-39.pyc
10.86 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rpo.cpython-39.pyc
5.96 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rsync.cpython-39.pyc
53.86 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
setmeta.cpython-39.pyc
11.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
signurl.cpython-39.pyc
20.99 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
stat.cpython-39.pyc
5.04 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
test.cpython-39.pyc
17.73 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ubla.cpython-39.pyc
6.96 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
update.cpython-39.pyc
12.26 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
version.cpython-39.pyc
5.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
versioning.cpython-39.pyc
5.51 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
web.cpython-39.pyc
7.63 KB
02/11/2025 08:19:49 AM
rw-r--r--
Editing: stat.cpython-39.pyc
Close
a +(Wg� � @ s4 d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlm Z ddl mZ dd l mZ dd l m Z ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddl!m"Z" dZ#de# d Z$G dd� de�Z%dS )zEImplementation of Unix-like stat command for cloud storage providers.� )�absolute_import)�print_function)�division)�unicode_literalsN)�BucketListingObject)�AccessDeniedException)�EncryptionException)�NotFoundException)�Command)�CommandArgument)�ApiSelector)�CommandException)�InvalidUrlError)�NO_URLS_MATCHED_TARGET)�ContainsWildcard)�StorageUrlFromString)�NO_MAX)�ENCRYPTED_FIELDS)�PrintFullInfoAboutObject)�UNENCRYPTED_FULL_LISTING_FIELDS)�GcloudStorageMapz gsutil stat url... z <B>SYNOPSIS</B> a <B>DESCRIPTION</B> The stat command outputs `object metadata <https://cloud.google.com/storage/docs/metadata>`_ for the specified object URLs. It is similar to running: gsutil ls -L gs://some-bucket/some-object but is more efficient because it avoids listing objects and gets the minimum necessary amount of object metadata. Moreover, because it avoids listing objects (which for some storage providers are eventually consistent) the ``gsutil stat`` command provides a strongly consistent way to check for the existence (and read the metadata) of an object. The ``gsutil stat`` command does, however, make listing object requests if you specify URLs using wildcards. If run with the ``gsutil -q`` option nothing is printed, e.g.: gsutil -q stat gs://some-bucket/some-object This behavior can be useful when writing scripts: even though nothing is printed from the command, it still has an exit status of 0 for an existing object and 1 for a non-existent object. NOTE: Unlike the gsutil ls command, the stat command does not support operations on sub-directories. For example, if you run the command: gsutil -q stat gs://some-bucket/some-subdir/ gsutil looks for information about an object called "some-subdir/" (with a trailing slash) inside the bucket "some-bucket", as opposed to operating on objects nested under gs://some-bucket/some-subdir/. Unless you actually have an object with that name, the operation fails. However, you can use the stat command on objects within subdirectories. For example, this command works as expected: gsutil -q stat gs://some-bucket/some-subdir/file.txt c @ sp e Zd ZdZejdg ededdddej ej gej e�� gd�Z ejdg dd ei d �Zeg d�i d�Zd d� ZdS )�StatCommandz&Implementation of gsutil stat command.�stat� � Fr )�command_name_aliases�usage_synopsis�min_args�max_args�supported_sub_args�file_url_ok�provider_url_ok�urls_start_arg�gs_api_support�gs_default_api�argparse_arguments�command_helpzDisplay object status)� help_name�help_name_aliases� help_type�help_one_line_summary� help_text�subcommand_help_text)�storage�objects�listz--fetch-encrypted-object-hashesz--stat)�gcloud_command�flag_mapc C s� t t }d}| jD �]h}d}t|�}|�� s4td��z�t|�rR| �|�j|d�}nbz"| j j |j|j|j |j|d�}W n0 ty� | j j |j|j|j |jtd�}Y n0 t||d�g}|D ]0}|�� r�|d7 }t�� �tj�r�t|dd� q�W n` t�y& t�� �tj��r"tj�d | d � Y n( t�y: � Y n t�yL Y n0 |st�� �tj��rxtj�t| d � d}q|�r�dS dS )z%Command entry point for stat command.Fr z,The stat command only works with object URLs)�bucket_listing_fields)� generation�provider�fields)�root_objectr )�incl_aclz+You aren't authorized to read %s - skipping� T)r r �argsr �IsObjectr r �WildcardIterator�IterObjects� gsutil_api�GetObjectMetadata�bucket_name�object_namer3 �schemer r �logging� getLogger�isEnabledFor�INFOr r �sys�stderr�writer r r ) �selfZstat_fieldsZfound_nonmatching_arg�url_strZarg_matches�url�blr_iterZ single_obj�blr� rN �"/opt/gsutil/gslib/commands/stat.py� RunCommand� sh �� ��� zStatCommand.RunCommandN)�__name__� __module__�__qualname__�__doc__r �CreateCommandSpec� _SYNOPSISr r �XML�JSONr �MakeZeroOrMoreCloudURLsArgument�command_spec�HelpSpec�_DETAILED_HELP_TEXT� help_specr �gcloud_storage_maprP rN rN rN rO r ] s>