Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
wps 命令行下打开相对路径的文件出错
Apps Section
1994
views ·
0
replies ·
To
floor
Go
yanbowen
deepin
Community Developer
2018-12-03 17:35
Author
本帖最后由 yanbowen 于 2018-12-3 09:38 编辑
最近在写一个 xlsx 生成的工具, 文件(test.xlsx)生成后, 使用
et ./test.xlsx
打开文件会提示
不支持的格式.
然后一直在查是不是代码有问题, 写了测试程序, 在 /tmp 下生成 test.xlsx 文件, 然后使用 et /tmp/test.xlsx 打开正常.
此时就尴尬了, 我的代码没有问题, 那就只能是 wps 的问题了. 对比发现:
传入文件的相对路径时就会出错, 传入绝对路径后就不会有问题了
.
可能是 wps 启动是更改了当前路径, 导致相对路径的文件找不到
.
另外建议细化下错误提示, 找不到文件时不要报格式错误, 很有误导性.
@cryfeifei
Reply
Like 0
Favorite
View the author
All Replies
No replies yet
Please
sign
in first
Featured Collection
Change
Nuntia - Modern IMAP/SMTP mail client for Deepin (Beta tester wanted!)
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
Taskbar no longer shows popups
Four agent skills for laptop power, sleep, and honest bug reports
Popular Events
More
最近在写一个 xlsx 生成的工具, 文件(test.xlsx)生成后, 使用 et ./test.xlsx 打开文件会提示不支持的格式.
然后一直在查是不是代码有问题, 写了测试程序, 在 /tmp 下生成 test.xlsx 文件, 然后使用 et /tmp/test.xlsx 打开正常.
此时就尴尬了, 我的代码没有问题, 那就只能是 wps 的问题了. 对比发现: 传入文件的相对路径时就会出错, 传入绝对路径后就不会有问题了.
可能是 wps 启动是更改了当前路径, 导致相对路径的文件找不到.
另外建议细化下错误提示, 找不到文件时不要报格式错误, 很有误导性.
@cryfeifei