bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

some NSFileManager bugs


From: Enrico Sersale
Subject: some NSFileManager bugs
Date: Sat, 6 Jul 2002 14:23:32 +0300 (EEST)

(due of my bad English I'll use a pratical example)

take a directory that contains some subdirectories, some plain files and a
symlink to one of the directories like this:

[root@img1 sviluppo]# ll GSPdf
total 168
drwxr-xr-x    2 root     root         4096 Jun 29 15:14 English.lproj
-rw-r--r--    1 root     root          203 Apr  5 13:16 Functions.h
-rw-r--r--    1 root     root          363 Apr  5 13:16 Functions.m
-rw-------    1 root     root          986 Jun 30 13:34 GNUmakefile
-rw-r--r--    1 root     root         2325 Nov  6  2001 GNUstep.h
-rw-r--r--    1 root     root         1237 Jun 26 13:34 GSConsole.h
-rw-r--r--    1 root     root         1761 Jun 26 14:04 GSConsole.m
drwxr-xr-x    4 root     root         4096 Jul  6 13:34 GSPdf.debug
-rw-r--r--    1 root     root         2473 Jul  1 13:44 GSPdfDocument.h
-rw-r--r--    1 root     root        12955 Jul  1 13:58 GSPdfDocument.m
-rw-r--r--    1 root     root         1688 Jun 28 13:57 GSPdfDocWin.h
-rw-r--r--    1 root     root         3456 Jun 28 14:13 GSPdfDocWin.m
-rw-r--r--    1 root     root         1562 Jun 30 12:41 GSPdf.h
-rw-r--r--    1 root     root         1237 Jun 30 13:36 GSPdfImView.h
-rw-r--r--    1 root     root         1299 Jun 30 13:37 GSPdfImView.m
-rw-r--r--    1 root     root          344 Jun 30 14:04 GSPdfInfo.plist
-rw-r--r--    1 root     root         5773 Jun 30 13:27 GSPdf.m
drwxr-xr-x    2 root     root         4096 Jun 30 14:07 Icons
-rw-r--r--    1 root     root         3136 Jun 30 12:31 main.m
lrwxrwxrwx    1 root     root           45 Jul  6 13:34 obj ->
./shared_debug_obj/ix86/linux-gnu/gnu-gnu-gnu
-rw-r--r--    1 root     root          694 Jun 29 12:57 papersizes.plist
-r--r--r--    1 root     root        48754 Jul  1 13:13 ps.c
-rw-r--r--    1 root     root         3818 Jun 26 14:17 PSDocument.h
-rw-r--r--    1 root     root         7942 Jun 26 14:17 PSDocument.m
-r--r--r--    1 root     root         3314 Jun 23 01:22 ps.h
drwxr-xr-x    3 root     root         4096 Jul  6 13:34 shared_debug_obj
drwxr-xr-x    2 root     root         4096 Jun 30 16:58 Test

1) copy the directory to an other location, for example "GSPdf_copy"
(I'm not using GWorkspace for this, only a simple program that calls
NSFileManager's -copyPath:toPath:handler: in main).

well, only the directories will be copied and, moreover, "obj" is not
anymore a symbolic link but a directory and contains the contents of
"./shared_debug_obj/ix86/linux-gnu/gnu-gnu-gnu".

2) try now to create an empty directory and copy *the contents* of the
first dir to the second one.

in this case, all the files are copied but "obj" is not anymore a symbolic
link;

3) now, using -removeFileAtPath:handler: try to remove the entire
directory "GSPdf" (the first one, that with the symbolic link).

the directory will not be removed and, if you cd into it, you will see
that all the files have been removed but not "obj".

run again your little program and, this time, the directory will be
deleted.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]