php-ftp-wrapper icon indicating copy to clipboard operation
php-ftp-wrapper copied to clipboard

fix bug in detecting file name (when there are two spaces in filename)

Open portey opened this issue 10 years ago • 3 comments

portey avatar Jul 24 '15 12:07 portey

Thanks! But can you port it in WindowsFilesystemFactory too?

touki653 avatar Jul 31 '15 11:07 touki653

@touki653 will you merge it?

patecki avatar Jun 04 '16 19:06 patecki

@touki653 I just wanted to reimplement the solution to WindowsFilesystemFactory because one project we inherited is using @portey’s fork and we would love to eliminate as much dev- versions as possible from our composer.json.

However, it is not trivial. IMHO the best thing would be rather big refactoring or, even better, use modern FTP extensions and MLSD command. The issue is text alignment in columns on Windows. The 3rd column holds the <DIR> thing and file size for regular files. The <DIR> indicator is aligned to the left and the file size to the right. All raw list lines are needed to properly detect where 4th column holding filename starts. In addition, it seems that for all-directory listings, Windows adds additional padding to the column making it even less deterministic and harder to detect. Moreover, there are differences from the dir command on my Windows machines to what WindowsFilesystemFactory expects and I don’t have IIS set up so I can’t test how FTP server actually behaves. Not to mention these nuances can depend on Windows/IIS version and/or some setting (e.g., locale).

f4z4on avatar Jan 04 '17 20:01 f4z4on