Changeset b19e892 in mainline for uspace/app/bdsh/cmds/modules/cp/cp.c
- Timestamp:
- 2017-04-02T10:39:13Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c4cf0d
- Parents:
- 80743a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cp/cp.c
r80743a1 rb19e892 35 35 #include <getopt.h> 36 36 #include <str.h> 37 #include <fcntl.h>38 37 #include <vfs/vfs.h> 39 38 #include <dirent.h> … … 383 382 printf("Copying %s to %s\n", src, dest); 384 383 385 if (-1 == (fd1 = open(src, O_RDONLY))) { 384 fd1 = vfs_lookup_open(src, WALK_REGULAR, MODE_READ); 385 if (fd1 < 0) { 386 386 printf("Unable to open source file %s\n", src); 387 387 return -1; 388 388 } 389 389 390 if (-1 == (fd2 = open(dest, O_WRONLY | O_CREAT))) { 390 fd2 = vfs_lookup_open(dest, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE); 391 if (fd2 < 0) { 391 392 printf("Unable to open destination file %s\n", dest); 392 393 close(fd1);
Note:
See TracChangeset
for help on using the changeset viewer.