This is the mail archive of the cygwin-developers@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bugs in chdir()?


Please look into the following sessions changing the current
directory to C:\TEMP.

Case 1. (No problem)
$ cd /cygdrive/c/TEMP/	# Use POSIX style path with a trailing slash.
$ pwd 
/cygdrive/c/TEMP        # Good.

Case 2.
$ cd C:/TEMP/		# Use Win32 style path with a trailing slash.
$ pwd
/cygdrive/c/TEMP/	# The trailing slash is left illegally.

Case 3.
$ cd '\TEMP'		# Use Win32 style path with a backslash.
$ pwd
/TEMP			# No such directory.

I think they are not bugs of chdir(), but bugs of the path
conversions and revealed via chdir(). The strace logs are
attached below.
____
  | AIST      Kazuhiro Fujieda <fujieda@jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology
Case 2.
  449   99110 [main] a 477 chdir: dir C:/TEMP/
  259   99369 [main] a 477 mount_info::conv_to_win32_path: conv_to_win32_path (C:/TEMP/)
  240   99609 [main] a 477 mount_info::conv_to_win32_path: C:/TEMP/ already win32
  242   99851 [main] a 477 normalize_win32_path: C:\TEMP\ = normalize_win32_path (C:/TEMP/)
  246  100097 [main] a 477 mount_info::conv_to_win32_path: C:\TEMP\(rel), C:\TEMP\(abs) 0x0(flags) = conv_to_win32_path (C:/TEMP/)
  469  100566 [main] a 477 symlink_info::check: not a symlink
  259  100825 [main] a 477 symlink_info::check: 0 = symlink.check (C:\TEMP, 0x240F3C9) (0x0)
  534  101359 [main] a 477 path_conv::check: GetVolumeInformation(C:\) = OK, full_path(C:\TEMP), set_has_acls(8)
  618  101977 [main] a 477 normalize_posix_path: src C:/TEMP/
  317  102294 [main] a 477 mount_info::conv_to_posix_path: conv_to_posix_path (C:/TEMP/, no-keep-rel, add-slash)
  414  102708 [main] a 477 normalize_win32_path: C:\TEMP\ = normalize_win32_path (C:/TEMP/)
  319  103027 [main] a 477 mount_info::conv_to_posix_path: /cygdrive/c/TEMP/ = conv_to_posix_path (C:/TEMP/)
  271  103298 [main] a 477 chdir: 0 = chdir() cygcwd.posix '/cygdrive/c/TEMP/' native 'C:\TEMP'
Case 3.
  446   97609 [main] a 329 chdir: dir \TEMP
  232   97841 [main] a 329 mount_info::conv_to_win32_path: conv_to_win32_path (\TEMP)
  247   98088 [main] a 329 mount_info::conv_to_win32_path: \TEMP already win32
  228   98316 [main] a 329 normalize_win32_path: \TEMP = normalize_win32_path (\TEMP)
  248   98564 [main] a 329 mount_info::conv_to_win32_path: \TEMP(rel), \TEMP(abs) 0x0(flags) = conv_to_win32_path (\TEMP)
  429   98993 [main] a 329 symlink_info::check: not a symlink
  271   99264 [main] a 329 symlink_info::check: 0 = symlink.check (\TEMP, 0x240F3D9) (0x0)
  226   99490 [main] a 329 path_conv::check: GetVolumeInformation(\TEMP) = ERR, full_path(\TEMP), set_has_acls(FALSE)
  797  100287 [main] a 329 normalize_posix_path: src \TEMP
  316  100603 [main] a 329 mount_info::conv_to_posix_path: conv_to_posix_path (\TEMP, no-keep-rel, no-add-slash)
  292  100895 [main] a 329 normalize_win32_path: \TEMP = normalize_win32_path (\TEMP)
  244  101139 [main] a 329 mount_info::conv_to_posix_path: /TEMP = conv_to_posix_path (\TEMP)
  277  101416 [main] a 329 chdir: 0 = chdir() cygcwd.posix '/TEMP' native '\TEMP'

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]