s******n 发帖数: 3946 | 1 文件本身不需要上锁吧?只要目录上锁。
能并发,比如dir1/dir2/dir3
把dir2改成dir2.1的时候可以同时把dir3改称dir3.1 |
|
d********e 发帖数: 132 | 2 在网上看到这个题:
given a path like: dir1/dir2/../dir3/./dir4, where ‘..’ means parent
directory and ‘.’ Means current directory, condense the given path. For
example, for the given string, the result should be: dir1/dir3/dir4
这道题是编程题还是用UNIX 命令? |
|
d******e 发帖数: 143 | 3 it's GNU make3.8
if there're 3 source files in 3 sub dir:(current dir is /proj)
/proj/A/a.c
/proj/B/b.c
/proj/C/c.c
/proj/obj
makefile in /proj:
################
DIR1 = ./A
DIR2 = ./B
DIR3 = ./C
OBJDIR = ./obj
VPATH=.:$(DIR1):$(DIR2):$(DIR3):$(OBJDIR)
#default target, link all objs to exe
test: a.o b.o c.o
g++ $^ -o $@
# compile cpp and put objs in OBJDIR
%.o : %.cpp
g++ -c $^ -o $(OBJDIR)/$@
################
problem:
first time run: make test, all 3 object files are created and save |
|
t*******l 发帖数: 421 | 4 比如在每个目录里有个子目录,其中包括一个文件含有我需要的信息。
$ ls
dir1 dir2 dir3
$ ls dir1
file1
$ more file1
user name: mary england
$ ls dir2
file2
$ more file2
user name: jon hotland
... ...
如果我想写个script,运行后会从第一到第三个目录自动找到user name,
用foreach file (*)语句后,却只读了第一个dir1,没有接着做dir2,dir3.
请帮我提示一下。多谢。 |
|
w*****t 发帖数: 485 | 5 做内部平台和工具的组
1) design:
设计一个metadata service,用在持续集成环境中, 用于接收和广播各个build
service push过来的状态和信息。
设计API (should be RESTful) , data model, etc.
(==> 应该类似于zookeeper的设计思路,只是restful ...)
2) coding:
合并两颗文件树:
Dir1
a1.txt
a2.txt
DD
a3.txt
Dir2
b1.txt
DD
b2.txt
EE
b3.txt
合并成: (同名子目录需要合并成一个)
Dir3
a1.txt
a2.txt
b1.txt
DD
a3.txt
b2.txt
EE
b3.txt |
|
A*********c 发帖数: 77 | 6 In a UNIX system I have a directory tree like
dir0/folder1/folder2/file1
dir1/folder1/folder2/file1
dir2/folder1/folder2/file1
dir3/folder1/folder2/file1
dir4/folder1/folder2/file1
...
Now I have got a newer version of file1 in dir0/folder1/folder2 and want to
ust it to replace every file1 above. Is there any command and/or program so
that I can finish my task using just one line (in reality I have more than 20
such directories)?
Thanks in advance! |
|