Opened 9 years ago

Closed 9 years ago

#5758 closed defect (invalid)

VSIArchiveFilesystemHandler::Stat() setting st_mode to S_IFREG has consequences for higher level functions

Reported by: hchen Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

VSIArchiveFilesystemHandler::Stat() (lines 498 to 510) in port/cpl_vsil_abstract_archive.cpp will set the st_mode of an archive to S_IFREG if it only contains one file. This affects other functions (e.g. os.path.isdir() in Python will return false for a zip accessed using the /vsizip/ virtual file system if it only contains one file). Is this the intended behaviour?

Attachments (1)

excerpt.cpp (452 bytes ) - added by hchen 9 years ago.
Relevant excerpt from VSIArchiveFilesystemHandler::Stat()

Download all attachments as: .zip

Change History (3)

by hchen, 9 years ago

Attachment: excerpt.cpp added

Relevant excerpt from VSIArchiveFilesystemHandler::Stat()

comment:1 by Even Rouault, 9 years ago

Yes, this is meant as a convenience. For example if I have byte.tif.zip that contains only byte.tif, I can directly do "gdalinfo /vsizip/byte.tif.zip" (I can do also gdalinfo /vzizip/byte.tif.zip/byte.tif", but that's longer to type).

comment:2 by Even Rouault, 9 years ago

Resolution: invalid
Status: newclosed

Closing as no feedback and I don't see any particular issue.

Note: See TracTickets for help on using tickets.