符号链接 [英] Symbolic Link

查看:108
本文介绍了符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个文件的链接,然后我可以在

HTML页面中使用。


系统是Linux上的托管的Web服务,运行python 2.3。

除此之外,我对系统一无所知。


链接创建正常,但是当我尝试使用它作为

IMG TAG的文件名,它不会显示。创建的

页面的页面源指向temp / test1.jpg链接


任何想法?


srcFile =" temp / test2.jpg"


linkFile =" temp / test1.jpg"


if os。 path.islink(linkFile):

print" Link Exists",nl

pass

else:

print" Making Link",nl

os.symlink(srcFile,linkFile)


print''< BR>< img src =" %s">图片< / IMG>< BR>< BR>''%linkFile


print''< img src ="%s">图像< / IMG>''%srcFile

I am trying to create a link to a file, which I can then use in an
HTML page.

The system is Linux on a hosted web service, running python 2.3.
Other than that I have no knowledge of the system.

The link is created OK, but when I try to use it as filename for the
IMG TAG, it does not get displayed. The page source of the created
page is pointing to the link as temp/test1.jpg

Any ideas ?

srcFile = "temp/test2.jpg"

linkFile = "temp/test1.jpg"

if os.path.islink(linkFile):
print "Link Exists", nl
pass
else:
print "Making Link", nl
os.symlink(srcFile, linkFile)

print ''<BR><img src="%s">the image</IMG><BR><BR>'' % linkFile

print ''<img src="%s">the image</IMG>'' % srcFile

推荐答案

mosscliffe schrieb:
mosscliffe schrieb:

我正在尝试创建一个文件的链接,然后我可以在

HTML页面中使用。


系统是Linux on一个托管的Web服务,运行python 2.3。

除此之外我不知道系统。


链接创建正常,但当我尝试将其用作

IMG TAG的文件名时,它不会得到显示。创建的

页面的页面源指向temp / test1.jpg链接


任何想法?


srcFile =" temp / test2.jpg"


linkFile =" temp / test1.jpg"


if os。 path.islink(linkFile):

print" Link Exists",nl

pass

else:

print" Making Link",nl

os.symlink(srcFile,linkFile)


print''< BR>< img src =" %s">图片< / IMG>< BR>< BR>''%linkFile


print''< img src ="%s">图像< / IMG>''%srcFile
I am trying to create a link to a file, which I can then use in an
HTML page.

The system is Linux on a hosted web service, running python 2.3.
Other than that I have no knowledge of the system.

The link is created OK, but when I try to use it as filename for the
IMG TAG, it does not get displayed. The page source of the created
page is pointing to the link as temp/test1.jpg

Any ideas ?

srcFile = "temp/test2.jpg"

linkFile = "temp/test1.jpg"

if os.path.islink(linkFile):
print "Link Exists", nl
pass
else:
print "Making Link", nl
os.symlink(srcFile, linkFile)

print ''<BR><img src="%s">the image</IMG><BR><BR>'' % linkFile

print ''<img src="%s">the image</IMG>'' % srcFile



该脚本在什么环境下运行?如果它是apache,那么apache设置可能不允许以下链接。


Diez

In what environment is that script running? If it''s apache, it might be
that the apache settings disallow for following links.

Diez


8月18日,23:49,Diez B. Roggisch < de ... @nospam.web.dewrote:
On 18 Aug, 23:49, "Diez B. Roggisch" <de...@nospam.web.dewrote:

mosscliffe schrieb:
mosscliffe schrieb:

我是尝试创建一个文件的链接,然后我可以在

HTML页面中使用它。
I am trying to create a link to a file, which I can then use in an
HTML page.


系统是托管网络服务上的Linux,运行python 2.3。

除此之外,我不知道系统。
The system is Linux on a hosted web service, running python 2.3.
Other than that I have no knowledge of the system.


链接创建正常,但当我尝试将其用作

IMG标签的文件名时,它确实没有显示。创建的

页面的页面源指向链接为temp / test1.jpg
The link is created OK, but when I try to use it as filename for the
IMG TAG, it does not get displayed. The page source of the created
page is pointing to the link as temp/test1.jpg


有什么想法吗?
Any ideas ?


srcFile =" temp / test2.jpg"
srcFile = "temp/test2.jpg"


linkFile =" temp / test1.jpg"
linkFile = "temp/test1.jpg"


if os.path.islink(linkFile):

print" Link Exists",nl

pass

else:

print" Making Link",nl

os.symlink(srcFile,linkFile)
if os.path.islink(linkFile):
print "Link Exists", nl
pass
else:
print "Making Link", nl
os.symlink(srcFile, linkFile)


print''< BR>< img src ="%s">图像< / IMG>< BR>< BR> ''%linkFile
print ''<BR><img src="%s">the image</IMG><BR><BR>'' % linkFile


print''< img src ="%s">图片< / IMG>''%srcFile
print ''<img src="%s">the image</IMG>'' % srcFile



该脚本在什么环境下运行?如果它是apache,那么apache设置不允许以下链接可能是




Diez


In what environment is that script running? If it''s apache, it might be
that the apache settings disallow for following links.

Diez



它是Apache。


我可以在当前目录中创建一些覆盖。我恐怕我的

Apache技能几乎为零。


谢谢


Richard

It is Apache.

Can I create some override in the current directory. I am afraid my
Apache skills are almost zero.

Thanks

Richard


mosscliffe schrieb:
mosscliffe schrieb:

8月18日,23:49,Diez B. Roggisch < de ... @nospam.web.dewrote:
On 18 Aug, 23:49, "Diez B. Roggisch" <de...@nospam.web.dewrote:

> mosscliffe schrieb:
>mosscliffe schrieb:

>>我正在尝试创建一个文件的链接,然后我可以在
HTML页面中使用。
系统是托管Web服务上的Linux,运行python 2.3。
除此之外,我不了解系统。
链接创建正常,但当我尝试将其用作
IMG TAG的文件名时,它不会显示。创建的
页面的页面源指向链接为temp / test1.jpg
任何想法?
srcFile =" temp / test2.jpg"
linkFile =" ; temp / test1.jpg"
如果os.path.islink(linkFile):
print" Link Exists",nl
传递
否则:
打印 ;制作链接",nl
os.symlink(srcFile,linkFile)
打印''< BR>< img src ="%s">图像< / IMG>< BR> ;< BR>''%linkFile
print''< img src ="%s">图片< / IMG>''%srcFile
>>I am trying to create a link to a file, which I can then use in an
HTML page.
The system is Linux on a hosted web service, running python 2.3.
Other than that I have no knowledge of the system.
The link is created OK, but when I try to use it as filename for the
IMG TAG, it does not get displayed. The page source of the created
page is pointing to the link as temp/test1.jpg
Any ideas ?
srcFile = "temp/test2.jpg"
linkFile = "temp/test1.jpg"
if os.path.islink(linkFile):
print "Link Exists", nl
pass
else:
print "Making Link", nl
os.symlink(srcFile, linkFile)
print ''<BR><img src="%s">the image</IMG><BR><BR>'' % linkFile
print ''<img src="%s">the image</IMG>'' % srcFile


该脚本在什么环境下运行?如果它是apache,可能是apache设置不允许以下链接。

Diez

In what environment is that script running? If it''s apache, it might be
that the apache settings disallow for following links.

Diez



它是Apache。


我可以在当前目录中创建一些覆盖。恐怕我的

Apache技能几乎为零。


It is Apache.

Can I create some override in the current directory. I am afraid my
Apache skills are almost zero.



和我一样。至少从我的头顶。你最好在一个更好的以b $ b bache为中心的论坛上询问。


Diez

As are mine. At least from the top of my head. You better ask in a more
apache-centric forum.

Diez


这篇关于符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆